A slightly more efficient way to return the HTTP code would
be to use the curl_getinfo function
function getHttpResponseCode($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_NOBODY, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$status = array();
$status = curl_getinfo($ch);
return $status['http_code'];
}
----
Server IP: 216.235.15.211
Probable Submitter: 71.206.111.161
----
Manual Page -- h
ttp://www.php.net/manual/en/function.curl-exec.php
Edit -- https://master
.php.net/note/edit/78654
Del: integrated -- h
ttps://master.php.net/note/delete/78654/integrated
Del: useless -- http
s://master.php.net/note/delete/78654/useless
Del: bad code -- htt
ps://master.php.net/note/delete/78654/bad+code
Del: spam -- https:/
/master.php.net/note/delete/78654/spam
Del: non-english --
https://master.php.net/note/delete/78654/non-english
Del: in docs -- http
s://master.php.net/note/delete/78654/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78654
Reject -- https://mast
er.php.net/note/reject/78654
Search -- https://
master.php.net/manage/user-notes.php
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|