<?php
header('Content-type: text/plain; charset=utf-8');
include('simple_html_dom.php');
$html = file_get_html('http://www.test.com/');
// Find all links
foreach($html->find('a') as $element) {
echo $element->href . '<br>';
}
?>
Why does this code not work? I still receive this error:
Call to a member function find() on a non-object in …
Try using var_dump to see the result of your function call.
Most likely the php.ini configuration forbids you to get external data. Check your phpinfo() for more details on this. The property to look at is 'allow_url_fopen'