You can search all files in a directory using the scandir function, and then comparing the name using the pathinfo function, using the PATHINFO_FILENAME . Feel free to change this script to your needs.
<?php
$dir = '/tmp';
$dirFiles = scandir($dir);
$search = 'lua';
foreach($dirFiles as $file) {
if (is_file($dir.'/'.$file) AND pathinfo($dir.'/'.$file, PATHINFO_FILENAME) == $search) {
// aqui você pode fazer o que quiser
echo "Arquivo encontrado: ".$dir.'/'.$file;
}
}
?>
Here are links to the php documentation for the functions used:
link
link