$file=file("http://go.163.com/~netnewbie/index.html"); $count=count($file); for($i=0;$i<$count;$i++){ if(eregi("<title>(.*)</title>",$file[$i],$out)){ $title=$out[0]; } } $title=substr($title,7,-8); echo $title; //此处$title的值为[网络新手] ?>