Skip to content

Instantly share code, notes, and snippets.

@thiagosf
Created June 17, 2011 17:16
Show Gist options
  • Save thiagosf/1031823 to your computer and use it in GitHub Desktop.
Save thiagosf/1031823 to your computer and use it in GitHub Desktop.
Pega título de uma URL
function getTitle ($url) {
$fh = fopen($url, "r");
$str = fread($fh, 1500);
fclose($fh);
$str2 = strtolower($str);
$start = strpos($str2, "<title>")+7;
$len = strpos($str2, "</title>") - $start;
return substr($str, $start, $len);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment