' . $domain . '...
';
//Remove excess whitespace
$domain = trim( $domain );
while( list( $n, $needle ) = each( $needles ) )
{
//Query
$url = 'http://www.google.com/search?hl=en&q=site%3A' . $domain . '%2F' . $needle . '&btnG=Google+Search';
//Web page returned as string
$data = file_get_contents( $url );
//Distinguish if there was or wasn't any results
if( strpos( $data, 'did not match any' ) > 1 )
{
//No results found in search
$display = 0;
}
else
{
//Results found
$display = 1;
}
if( $display > 0 )
{
//Display results to user
echo $data;
}
else
{
//Inform user that there was no data for the domain
echo ' Nothing for ' . $domain . ' ' . $needle . '
';
}
//Remove variable from memory for next iteration
unset( $display );
//Delay each query if needed
//sleep( 1 );
}
//Delay each query if needed
sleep( 15 );
//Move pointer back to start of array
reset( $needles );
//Increase counter
$counter++;
}
?>