Re: Scrubbing URL's

From: Date: Thu, 13 Jul 2006 23:03:31 +0000
Subject: Re: Scrubbing URL's
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-239450@lists.php.net to get a copy of this message
Hi, You can also do this using the following code: $fh = @fopen($url, "r"); if ($fh) {
    fclose($fh);
} else {
    echo "URL ($url) doesn't exists";
} This does work for the HTTP code 200 and 400. I am not sure how it handles the redirects Code 302. Regards, Amit Arora www.digitalamit.com Paul Nowosielski wrote:
Dear All, I have 150,000 + URLS I need to validate. When I say validate, I mean I would like to verify the URL opens up a web page that returns a '200' and not a '404'. I was thinking of first verifying the host has a DNS A record by using checkdnsrr(). Then using CURL to check server response. Does any one know of a function or class that already does this? Your thoughts would be greatly appreciated. TIA!


« previous php.general (#239450) next »