glob() will return an array containg all file names with the given file type.
Following code will show you how to get a list of only .gif image files from the image folder.
<?php
//get only .gif files from images folder
$files_list = glob("images/*.gif");
foreach($files_list as $files)
{
echo $files;
echo '<br />';
}
?>
No comments:
Post a Comment