码迷,mamicode.com
首页 > Web开发 > 详细

php爬取网页

时间:2014-11-19 18:49:46      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:php

<?php
$url="http://blog.51cto.com/9519231/1571112";
$fp=@fopen($url,'r') or die("超时");
$fcontents=file_get_contents($url);
ereg("<!--正文 begin-->(.*)<!--正文 end-->",$fcontents,$rg);
echo $rg[1];
?>

php爬取网页

标签:php

原文地址:http://blog.csdn.net/dapeng0112/article/details/41283529

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!