在我的用户界面中,有一个文本区域,其中包含一个由新行分隔的URL列表。simpleHTMLdom - 使用数组中的多个URL
我正在将它放入一个字符串中,并使用换行符对其进行爆炸。我收到此错误:
Fatal error: Call to a member function find() on a non-object in C:\xampp\htdocs\apps\lt\track-them.php on line 34
$myurl = "http://mydomain.com/testpage1.html";
$str = "http://www.domain.com/page1.html
http://www.homepage.com/page2.html
http://www.internet.com/index.html";
$backlinkarr = explode("\n", $str);
echo '<table border=1>';
foreach ($backlinkarr as $backlinkitem) {
$backlinkitem = trim($backlinkitem);
$LinkCount = 0;
$html = file_get_html($backlinkitem);
foreach ($html->find('a') as $link) {
if ($link->href == $myurl) {
$LinkCount += $LinkCount + 1;
}
}
echo $backlinkitem . ' (' . $linkCount . ')';
}
''file_get_html()''?有这样的功能吗?还有更多...一个PHP类?或者它是你的类,你并没有显示所有......和''html''被调用作为函数没有类.. –
我相信这是关于http://simplehtmldom.sourceforge.net/ – jancha
是的,这是正确的simplehtmldom例子。 – Ram