[wd_asp elements=’search’ ratio=’100%’ id=1]

List all files in directory

18th October 2013

Php - Strings

php codehaven

//path to directory to scan
$directory = "../";

//get all image files with a .jpg extension.
$images = glob($directory . "*.jpg");

//print each file name
foreach($images as $image)
{
echo $image;
}