$url = 'http://bhndev.spaces.msn.com/blog/'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 4); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_MAXREDIRS, 2); $data = curl_exec($ch); $return_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); echo $return_code;