Also, assuming your server host didn't disable this feature (enabled by default) for security reasons (
allow_url_fopen) you can also get the contents of a file via URL with ...
file (returns file as array, split on linebreaks)
fopen (opens read/write/append file-handle)
file_get_contents (returns whole file as string)
Write ups of these functions
file --
http://us.php.net/manual/en/function.file.php
fopen ---
http://us.php.net/manual/en/function.fopen.php
file_get_contents --
http://us.php.net/manual/en/function...t-contents.php
allow_url_fopen --
http://us2.php.net/manual/en/filesys...llow-url-fopen
Just thought you might like to know
<?php
$word = 'search'; // found
//$word = 'phat'; // not found
$file = file_get_contents( 'http://www.google.com' );
if ( preg_match( "/$word/i", $file ) ) {
print "word: $word";
} else {
print "phat";
}
?>