An easy way to get images from a directory using php:
//path to directory to scan $directory = dirname(dirname(__FILE__)) . '/my_image_dir/'; //get all image files with a .jpg, gif and png extension. $images = glob($directory . "*.{jpg,gif,png}", GLOB_BRACE); //print each file name foreach ($images as $image) { echo basename($image) . " "; }
Leave a Reply