title: PHP how to list all files in directory in a combobox - only file names and not with full paths
body: <p>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.</p>
  
  <p>here is the code</p>
  
  <pre><code>$files = glob('images/items/Done/*.jpg');
  echo "&lt;select&gt;";
  foreach ($files as $file) {
  echo "&lt;option&gt;".$file."&lt;/option&gt;"; }
  echo "&lt;/select&gt;";
  </code></pre>
  
  <p>Everything works fine ..except I want only file names listed and not the whole path.</p>
  
  <p>NOT images/items/Done/picture.jpg</p>
  
  <p>BUT picture.jpg</p>