$url = 'http://google.com/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
var_dump(curl_exec($ch));
var_dump(curl_error($ch));
bool(false) string(34) "Could not resolve host: google.com"