Nope.
You've only opened the file, you haven't actually read it into any variable.
Also you haven't told stristr where to search for the string you want to find.
Did you read those manual pages?
Try:
<?php
function searchpage($remotePage, $searchString) {
$fp = fopen($remotePage, 'r');
if ($fp===false ) {
// error reading or opening file
return false;
}
$contents = fread($fp, 9999999);
fclose($fp);
if (stristr($contents, $searchString){
return TRUE;
}else{
return FALSE;
}
}
?>
This function reads in the contents of the remote page and searches it for the string you want to find. I'm afraid I don't have access to a PHP enviornment here, so I can't test it. It probably needs some debugging, but it should get you well on the way.
As a learning exercise for you, you might want to change it to read the remote file line by line instead of reading the whole thing in in one go. This will make it faster and more memory efficient.
Note, to use fopen to open a remote web page, your PHP will ned to be configured accordingly... see the manual for further detail