function file_get_contents_curl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$html = file_get_contents_curl("https://www.keywordsandwebsites.com/");
$doc = new DOMDocument();
@$doc->loadHTML($html);
$title = $doc->getElementsByTagName('title');
echo $title->item(0)->nodeValue;
/*
run:
Keywords and Websites – Top quality websites for represented keyword
*/