i want extract TITLE tag from web site url: http://www.varzesh3.com. I tried many ways but not.
my codes:
$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;
$tags = get_meta_tags($url);
print_r ($tags);