Hi I need to search the a catalogue in the filesystem and find files without knowing it extension and came up with this:
where $theFile is the file eg.
myfile
if ($dir = @opendir("./")) {
while (($file = readdir($dir)) !== false) {
$foo = explode(".", $file);
if ($theFile == $foo[0]) {
echo $file."<br>\n";
}
}
closedir($dir);
}
Is there a faster way.