网页Http返回状态值查询(404,200,301,302,500)这种如何实现呢? 例如像这个网站的。可以查询网站的返回状态http://www.mjjer.com/gethttpheader.php 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 curl为例:function curl_file_get_contents($durl){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $durl); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $r = curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); return $http_code;} function curl_file_get_contents($durl){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $durl); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $r = curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); return $http_code;}是个好东西!! 怎么实现csdn的左边显示php论坛类型,右边从数据库调出所需的数据 PHP如何建立2个关键字的搜索 我郁闷zend编辑器不知道怎么处理这么些东西 ecshop问题 WordPress自定义功能出错,寻求帮助,谢谢 ubuntu上安装phpde apc扩展模块的问题 嘿嘿,php的汉语编程 thinkphp 静态缓存的问题 金融快讯网站怎么实时更新信息 多个链接指向了一页面的问题,求助这种问题的解决办法 php 飞信接口怎么不能用了 有关php调用lucene(JAVA)代码的问题
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $durl);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$r = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
return $http_code;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $durl);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$r = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
return $http_code;
}是个好东西!!