title: Getting images from sub-directory to show
body: <p>I am trying to make a latest news system with the possibility to select a featured image from the directory where all those images are. Let me show you what I got</p>
  <pre><code>&lt;?php
  $files = glob(&quot;../assets/images/newsimages/*.*&quot;);
   var_dump($files);
   for ($i = 0; $i &lt; count($files); $i++) {
      
     $image = $files[$i];
     $supported_file = array(
      'gif',
      'jpg',
      'jpeg',
      'png'
      );
  
  $ext = strtolower(pathinfo($image, PATHINFO_EXTENSION));
  
  if (in_array($ext, $supported_file)) {
  echo '&lt;option value=&quot;'. $image .'&quot;&gt;' . basename($image) . '&lt;/option&gt;';
  } else {
  continue;
  }
  }
  ?&gt;
  </code></pre>
  <p>The problem I am running into is that I want to load the images in the admin without ../assets/images/ because when I post this it will come ../assets/images/newsimages/img.jpg in the news table in the database. I want to load the $files like assets/images/newsimages/</p>