117_myfile.doc
14_expenses.pdf
'117_' would be the format of the prefix added to the filename. More than one file can have the same prefix. What I want to do is display all of the files with a certain prefix. I can already display all of the files in the directory. The code I am using for that is below. I just don't know how to target a certain prefix.
I would appreciate any help thrown my way!
Code: Select all
function DirDisply() {
$TrackDir=opendir("../doc/bid/");
while ($file = readdir($TrackDir)) {
if ($file == "." || $file == "..") { }
else {
print "<tr><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\"> <a href=../doc/bid/$file target=_blank id=\"black\">$file</a></font></td>";
print "<td></td></tr><br>";
}
}
closedir($TrackDir);
return;
}
@ DirDisply();