Maybe something is missing for me ... but the DOM object is empty in this code:
$input = file_get_contents('http://www.google.com/');
$doc = new DOMDocument();
@$doc->loadHTML($input);
var_dump($doc);
die();
I really don't know what could be wrong with this code. I confirmed that $ input is actually populated with the html content of the webpage.
Output: object (DOMDocument) # 3 (0) {}
I do not understand why...
source
share