
php中抓取网页内容的实例详解
方法一:
使用file_get_contents方法实现
$url = “http://news.sina.com.cn/c/nd/2016-10-23/doc-ifxwztru6951143.shtml”;
$html = file_get_contents($url);
//如果出现中文乱码使用下面代码
//$getcontent = iconv(“gb2312”, “utf-8”,$html);
echo “
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...