Hello guys I want to get an HTML node from website to show it in my website, but I can't do it.
This is my code.
$html = htmlentities(file_get_contents("http://stackoverflow.com/"));
$doc = new DOMDocument();
$doc->loadHTML($html);
$h1 = $doc->getElementsByTagName("title");
var_dump($h1);
And this is the result.
object(DOMNodeList)#2 (1) {
["length"]=>
int(0)
}
Please help. Thanks in advance.