有谁知道为什么我有这个错误?我做错了什么?
<?
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() 第5行的../simplehtml.php
答案 0 :(得分:1)
您忘记添加函数名称file_get_html
,代码应如下所示:
<?php
include 'simple_html_dom.php';
$html = file_get_html("http://99designs.pt/logo-design/contests?show=finished");
foreach($html->find('span[class=active.sl_notranslate]') as $aholder) {
echo $aholder . '<br>';
}
?>