Created
June 13, 2011 20:59
-
-
Save squiter/1023682 to your computer and use it in GitHub Desktop.
Get http response code from a URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Check HTTP Header Response | |
* Author: Brunno dos Santos | |
* Version: 1.0 | |
* Usage: run php check_http.php www.yoursite.com | |
*/ | |
$ch = curl_init($argv[1]); | |
curl_setopt($ch, CURLOPT_NOBODY, 1); | |
$c = curl_exec($ch); | |
echo curl_getinfo($ch, CURLINFO_HTTP_CODE)."\n\r"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment