Return to Snippet

Revision: 8781
at October 7, 2008 13:34 by bdhamilton


Initial Code
function url_exists($url) {
    $hdrs = @get_headers($url);
    return is_array($hdrs) ? preg_match('/^HTTP\\/\\d+\\.\\d+\\s+2\\d\\d\\s+.*$/',$hdrs[0]) : false;
}

Initial URL
http://us2.php.net/manual/en/function.file-exists.php#84918

Initial Description

                                

Initial Title
Test whether URL exists

Initial Tags

                                

Initial Language
PHP