Skip to content

Instantly share code, notes, and snippets.

@lamprosg
Created July 18, 2012 20:50
Show Gist options
  • Select an option

  • Save lamprosg/3138796 to your computer and use it in GitHub Desktop.

Select an option

Save lamprosg/3138796 to your computer and use it in GitHub Desktop.
LIST ALL FILES IN A DIRECTORY
//path to directory to scan
$directory = "../images/team/harry/";
//get all image files with a .jpg extension.
$images = glob($directory . "*.jpg");
//print each file name
foreach($images as $image)
{
echo $image;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment