I have a little function that is taking a list of files in a directory and putting them in a form select. It works great except I am getting the directory path as well as the file name and I just want the filename in the select. How can I accomplish that?
foreach (glob("/directory_path/*.wmv")as $filename) {
echo "<option value=\"$filename\">$filename</option>";
}
This displays:
<select name="file"><option value="none" selected>Select a file</option><option value="/directory_path/file1.wmv">/directory_path/file1.wmv</option><option value="/directory_path/file2.wmv">/directory_path/file2.wmv</option>
-mx