Code Snippets Php

//find a match in a file
//our pattern
$pattern = "html";
//open the websites file for reading
if(!$fp = fopen("websites.txt","r"))
{
echo "cannot open the file";
}
else
{
//while the file is not empty
while(!feof($fp))
{
//read a line at a time to try and find a match
$read_line = fgets($fp,255);
if($read_line == $pattern)
echo "We have a match
";
}
fclose($fp);
}
?>