更新时间:2022-03-12 22:26:07
<?php
ini_set('display_errors', 1);
include_once('simple_html_dom.php');
$html = file_get_html('http://www.dsebd.org/dseX_share.php');
$table = $html->find('table', 5);
$rowData = array();
foreach ($table->find('tr') as $row)
{
foreach ($row->find('td') as $cell)
{
$flight = array();
$cell->plaintext= preg_replace('/<\/[\w]+>/',"",$cell->plaintext);
$flight[] = array_map('trim', preg_split("@(\ )+@", $cell->plaintext));
}
$rowData=array_merge($rowData,$flight);
}
print '<pre>';
print_r($rowData);
print '</pre>';
?>