I am looking to modify this php code to do a recursive "search for and display image" on a single, known, directory with an unknown amount of sub-directories.
Here's the code I have that scans a single directory and echoes the files out to html:
<?php
foreach(glob('./img/*.jpg') as $filename)
{
echo '<img src="'.$filename.'"><br>';
}
?>
Given that the base directory $base_dir="./img/";
contains sub-directories having unknown amounts and tiers of their own sub-directories which all include only .jpg file types.
Basically need to build an array of all the paths of the sub-directories.