I have this code:
<?php
$LF = 'links.txt';
$Rfp = fopen($LF, 'r');
while(!feof($Rfp))
{
$links = fgets($Rfp);
$tags = get_meta_tags($links);
if ($tags['description'] == "")
echo "No META Description Found";
else
echo $tags['description'];
}
fclose($Rfp);
?>
My links.txt has a list of 5000 URLS one per line. I get this error for every URL in my file, when I execute this script
Warning: get_meta_tags(http://www.1saleaday.com ) [function.get-meta-tags]: failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known. in F:\xampp\htdocs\mte.php on line 10
No META Description Foundhttp://www.1stopflorists.com
Warning: get_meta_tags() [function.get-meta-tags]: php_network_getaddresses: getaddrinfo failed: No such host is known. in F:\xampp\htdocs\mte.php on line 10
I am sure that the links I have in my links.txt file, all have META description. So, where am I failing? Please guide.
Apparently, PHP is unable to load the page. Perhaps the links don’t have the proper format?
A quick test shows that this happens when I try
get_meta_tags('http://domain.com http://another-domain.com');, perhaps there is something wrong with the newlines?(Windows vs Unix line-endings?)