I have used following php code to get all images names from relevant directory.
$dir = "images";
$images = scandir($dir);
$listImages=array();
foreach($images as $image){
$listImages=$image;
echo ($listImages) ."<br>";
}
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.
- Parent Dir
- Sub Dir
- image1
- image2
- Sub Dir2
- image3
- image4
- Sub Dir
How I go through the all sub folders and get the images names?