PHP獲取網址的http code狀態碼或其它header方法

以前一直採用curl方案獲取http code,代碼以下:php $ch = curl_init('http://www.baidu.com'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_exec($ch); echo curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); 一直工做
相關文章
相關標籤/搜索