Posted inAll / Php

Search keywords from static files

<?php
$content = file_get_contents('filename.html'); //Example file_get_contents('filename.hml');

// Here $key is the search word //Example $key = "php";
if(preg_match("/".$key."/", $content, $matches))
{
   echo "found";
}
else
{
   echo "not found";
}

Leave a Reply