List Files in Directory | PHP

austinleath

March 17th, 2021 04:25:20 PM

					
<?php $listOfFiles = glob("*.{jpg,png,gif,tiff,jpeg}", GLOB_BRACE); echo 'images = []; '; for($x = 0; $x <= count($listOfFiles)-1; $x++) { echo "images[" . $x . "] =" . '"' . $listOfFiles[$x] . '"' . "; "; } ?>

Featured Posts