title: How to get image names from all sub directories?
body: <p>I have used following php code to get all images names from relevant directory. </p>
  
  <pre><code>$dir = "images";
  $images = scandir($dir);
  $listImages=array();
  foreach($images as $image){
      $listImages=$image;
      echo ($listImages) ."&lt;br&gt;";
  }
  </code></pre>
  
  <p>This one works perfectly. But I want to get all images file names within all sub directories from relevant directory. Parent directory does not contain images and all the images contain in sub folders as folows. </p>
  
  <ul>
  <li>Parent Dir
  
  <ul>
  <li>Sub Dir
  
  <ul>
  <li>image1</li>
  <li>image2</li>
  </ul></li>
  <li>Sub Dir2
  
  <ul>
  <li>image3</li>
  <li>image4</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>How I go through the all sub folders and get the images names?</p>