/ Published in: PHP
To make an image browser, add these lines:
$ext = strtolower(substr("$dirArray[$index]", strrpos("$dirArray[$index]", '.') + 1)); //get file extensions
if ("$ext" == "jpg") { // if file is a jpg
print("$dirArray[$index]<a href=\"$dirArray[$index]\"></a>"); // show image and create link to it
$ext = strtolower(substr("$dirArray[$index]", strrpos("$dirArray[$index]", '.') + 1)); //get file extensions
if ("$ext" == "jpg") { // if file is a jpg
print("$dirArray[$index]<a href=\"$dirArray[$index]\"></a>"); // show image and create link to it
URL: http://www.liamdelahunty.com/tips/php_list_a_directory.php