I use a script that allows me to find a file in a folder whose keyword matches the word chosen by the user, but the problem is that the result does not match the search keyword.
For example the user searches for the word "Hyper-v" and either it comes out files that have no relationship or it comes out nothing.
Thank you for your help
$findThisString = stripcslashes($_POST["recherchemotcle"]);
$path = "tuto";
$dir = opendir($path);
while (false !== ($file = readdir($dir)))
{
$data = file_get_contents($path . '/' . $file);
if (stripos($data, $findThisString) !== false)
{
echo ''.$file.' <br/>';
}
}
$dir->close();