$_SERVER get code status
function getStatusCode($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_NOBODY, TRUE); // remove body curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return $status; }