I am trying to create a form where the user can select what image should be linked to what item before he inserts it into a database.
here is the code
$files = glob('images/items/Done/*.jpg');
echo "<select>";
foreach ($files as $file) {
echo "<option>".$file."</option>"; }
echo "</select>";
Everything works fine ..except I want only file names listed and not the whole path.
NOT images/items/Done/picture.jpg
BUT picture.jpg