21,886
社区成员
发帖
与我相关
我的任务
分享
preg_match("/<head>(.*)<\/head>/i",$content, $matches);
eregi("<head>(.*)</head>",$content, $matches);
require_once("snoopy.class.php");
$snoopy = new Snoopy;
$url="http://www.sina.com.cn";
$snoopy->fetch($url);
$content = $snoopy->results;
preg_match("/<head>(.*?)<\/head>/is",$content, $matches);//这样应该可以了
print_r($matches);
require_once("snoopy.class.php");
$snoopy = new Snoopy;
$url="http://www.sina.com.cn";
$snoopy->fetch($url);
$content = $snoopy->results;
preg_match("/<head>(.*)<\/head>/i",$content, $matches);
print_r($matches);
preg_match("/<head>(.*)<\/head>/mi",$content, $matches);
是这样吗?经测试还是不行啊。