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.