PHP头条
热点:

用PHP抓取新闻的例子




新闻







医保网滚动新闻

新闻每分钟刷新一次
$handle = fopen("http://dailynews.sina.com.cn/news1000.shtml","r");
$sign = 0;
while(!feof($handle))
{
$message = fgets($handle,512);
if($sign == 1)
{
print("$message");
}
if(ereg("新闻开始",$message,$result))
{
$sign = 1;
}
else if(ereg("新闻结束",$message,$result))
{
$sign = 0;
}
}
fclose($handle);

?>
 

天淞电子商务开发有限公司


www.phpzy.comtrue/phprm/39071.htmlTechArticle用PHP抓取新闻的例子 新闻 医保网滚动新闻 新闻每分钟刷新一次 $handle = fopen("http://dailynews.sina.com.cn/news1000.shtml","r"); $sign = 0; while(!feof($handle)) { $message = fgets($handle,512); if($sign == 1) { prin...

相关文章

    暂无相关文章

PHP之友评论

今天推荐