this code not display title when i get link from txt file
<?php
function page_title($url) {
$fp = file_get_contents($url);
if (!$fp)
return null;
$res = preg_match("/<title>(.*)<\/title>/siU", $fp, $title_matches);
if (!$res)
return null;
// Clean up title: remove EOL's and excessive whitespace.
$title = preg_replace('/\s+/', ' ', $title_matches[1]);
$title = trim($title);
return $title;
}
$file = fopen("link.txt","r");
$lien = fgets($file);
fclose($file);
print page_title($lien);
?>
this code not display title when i get link from txt file
blank screen
my link.txt countains :