$ch = curl_init('http://www.yahoo.com/'); curl_exec($ch); $code = curl_getinfo($ch,CURLINFO_HTTP_CODE); if (($code == 301) || ($code == 302)) { //This was a redirect }
$ch = curl_init('http://www.yahoo.com/'); curl_exec($ch); $code = curl_getinfo($ch,CURLINFO_HTTP_CODE); if (($code == 301) || ($code == 302)) { //This was a redirect }