php如何抓取网页

php如何抓取网页

<?php 
$url = "http://www.pc100.net"; 
$contents = file_get_contents($url); 
//如果出现中文乱码使用下面代码 
//$getcontent = iconv("gb2312", "utf-8",$contents); 
echo $contents; 
?> 

来自: http://www.thinkphp.cn/topic/28229.html

原文地址:https://www.cnblogs.com/python001/p/4307317.html