php file_get_contents 为什么有的网页无法读取? $path="http://www.baidu.com/s?wd=qq";$html=file_get_contents($path);echo $html;什么都没有!为什么百度的这个不能读取?各位有什么好的办法? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我试了也不稳定,不过我换了一个方法. $fp = fsockopen("www.baidu.com", 80, $errno, $errstr, 30); if (!$fp) { die($error->show_error($lang[failure],'指定的参数格式错误')); } else { $out = "GET /{$L}pv/{$cid}d.html HTTP/1.1\r\n"; $out .= "Host: www.enf.cn\r\n"; $out .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.12) Gecko/2009070611 Firefox/3.0.12\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); $i=1; while (!feof($fp)&&$i<1000) { $c.= fgets($fp, 1024); $i++; } fclose($fp); } php5 soapclient改一下类名 Flash使用AMF与PHP通信 申通验证码怎么取得 遇到麻烦 求高手 获取某一元素问题,急 求开源商城!来者有分! mb_http_output('pass');这个是什么意思啊? setcookie 注册页面出现Column count doesn't match value count at row 1 关于接口的问题 SMTP问题.急,谢谢大家.会的请进.... 求分类信息的网站
$fp = fsockopen("www.baidu.com", 80, $errno, $errstr, 30);
if (!$fp) {
die($error->show_error($lang[failure],'指定的参数格式错误'));
} else {
$out = "GET /{$L}pv/{$cid}d.html HTTP/1.1\r\n";
$out .= "Host: www.enf.cn\r\n";
$out .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.12) Gecko/2009070611 Firefox/3.0.12\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
$i=1;
while (!feof($fp)&&$i<1000) {
$c.= fgets($fp, 1024);
$i++;
}
fclose($fp);
}