【发布时间】:2014-11-02 23:57:54
【问题描述】:
有人知道我为什么会出现这个错误吗?我做错了什么?
<?
include('simple_html_dom.php');
$html = ("http://99designs.pt/logo-design/contests?show=finished");
foreach($html->find('span[class=active.sl_notranslate]') as $aholder) {
echo $aholder . '<br>';
}
?>
致命错误:在非对象上调用成员函数 find() ../simplehtml.php 第 5 行
【问题讨论】:
-
在这种情况下,
$html是一个字符串,因此它不会附加任何方法。 -
谢谢,错过了这个:
$html = file_get_html($url);你知道我如何回应“span”内容吗?