questo funziona in parte:
Codice PHP:
$file = file("http://www.pippo.it");
$file = implode("",$file);
if(preg_match("/<title>(.+)<\/title>/i",$file,$m)){
print "The title of $url is [b]$m[1]";}
else{ print "The page doesn't have a title tag";}
pero' io vorrei passare un url dinamicamente tramite variabile, cosi:
Codice PHP:
$file = file($url);
$file = implode("",$file);
if(preg_match("/<title>(.+)<\/title>/i",$file,$m)){
print "The title of $url is [b]$m[1]";}
else{ print "The page doesn't have a title tag";}
pero' non funziona...come mai?