View Single Post
Old 05-22-2008, 10:17 PM  
Zoose
Confirmed User
 
Join Date: Aug 2006
Posts: 268
Here's a version that uses curl:

Quote:
<?php

$list_of_urls = file( "urls.txt" );

while( list( $key, $value ) = each( $list_of_urls ) ){

$curl_handle = curl_init();

curl_setopt( $curl_handle, CURLOPT_URL, $list_of_urls[$key] );
curl_setopt( $curl_handle, CURLOPT_RETURNTRANSFER, true );

$response = curl_exec( $curl_handle );
$response_code = curl_getinfo( $curl_handle, CURLINFO_HTTP_CODE );

if( $response_code == '404' ){

echo $list_of_urls[$key]." appears to be 404<br>";

}

}

?>
Make a urls.txt file and put one url per line.
Zoose is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote