I am trying to get my code to work. I basically check that if a folder exists, and any sub folder exists within that directory called 3 or more (3,4,5) then do a loop, otherwise nothing.
// the folder path
$folderPath="".cdnurl."assets/".pid."";
// looks like site.com/assets/342/
// is there a sub folder called 3 or more, 3,4,5 and loop from 3
// site.com/assets/342/3
// site.com/assets/342/4
// etc, we only loop if 3 exists other wise nothing
$folderSubNumber =>3;
while(file_exists($folderPath.$folderSubNumber)) {
echo '<li><img src="assets/pid/'.folderSubNumber.'';
} else {
// nothing
echo "";
}
1 Answer