This example will return the status code of the web page using PHP and CuRL. These type of routines are useful for example if you were to check the status of your site and say send an email the moment it was down or not responding.
$curl = curl_init(‘http://www.google.com/’);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
//dump information about the
print(“STATUS CODE: ” . curl_getinfo($curl, CURLINFO_HTTP_CODE) .'<br>’);