/ Published in: PHP
List all files in a diretory with glob
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//path to directory to scan $directory = "../images/team/harry/"; //get all image files with a .jpg extension. //print each file name foreach($images as $image) { echo $image; }
URL: http://www.brightcherry.co.uk/scribbles/php-list-all-files-in-a-directory/