I am trying to load a dom object and to parse it for finding specific links
Here is my code:
$content = file_get_contents("http://www.example.com/example.php");
$dom = new DOMDocument();
$dom->loadHTML($content);
$dom->preserveWhiteSpace = false;
var_dump($dom);
What I get is:
object(DOMDocument)#1 (0) { }
If i echo the $content I get all the html.
What is wrong in my code?
This is an example from the manual: DOMDocument