这样采集出来连接地址是本地,大概因为被采集的站连接也是本地吧?怎么才能把连接的新闻连到采集的正确的URL上去?
复制内容到剪贴板
代码:
<?php
$str = file_get_contents("http://sports.tom.com/yc/manutdmore.html");
preg_match_all("#<li>(.*)</li>#i",$str,$outstr);
for($i=0;$i<count($outstr[0]);$i++)
{
echo "\t\t\t\t".preg_replace("#<li>(.*)</li>#i","\\1",$outstr[0][$i])."\n";
}
?>