Thursday, 15 May 2014

PHP Simple HTML DOM Parser [fatal error Call to a member function find() on a non-object ] -



PHP Simple HTML DOM Parser [fatal error Call to a member function find() on a non-object ] -

anyone knows why have error? doing wrong?

<? include('simple_html_dom.php'); $html = ("http://99designs.pt/logo-design/contests?show=finished"); foreach($html->find('span[class=active.sl_notranslate]') $aholder) { echo $aholder . '<br>'; } ?>

fatal error: phone call fellow member function find() on non-object in ../simplehtml.php on line 5

you forgot add together function name file_get_html, code should this:

<?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]') $aholder) { echo $aholder . '<br>'; } ?>

php html dom get

No comments:

Post a Comment