我想用PHP检索表格单元格的内容到另一个文件。使用此代码,我检索行的全部单元的内容。PHP获取单元格内容
$url = 'folder/myPage.php';
$content = file_get_contents($url);
$first_step = explode('<tr id="foo">' , $content);
$second_step = explode('</tr>' , $first_step[1]);
echo $second_step[0];
如何检索特定的单元格? (第二个,例如...)
$url = 'folder/myPage.php';
$content = file_get_contents($url);
//Ugly Code !...doesn't work !
$first_step = explode('<tr id="foo"><td[1]' , $content);
$second_step = explode('</td></tr>' , $first_step[1]);
echo $second_step[0];
Thanks.Nicolas。
您不应该使用PHP来检查DOM文档,但无论如何..如果您确实使用了[library](http://simplehtmldom.sourceforge.net/)。 – Xorifelse
我会尽力的。谢谢。 –
如果它不是PHP,它是AJAX? Jquery? –