$ch = curl_init('http://www.jb51.net'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_exec($ch); echo curl_getinfo($ch, CURLINFO_HTTP_CODE); // 200 curl_close($ch);