I am reading all image files by this code.
Code: Select all
$dir = "images/";
$jpgext = ".jpg";
$dh = opendir($dir);
while($filename = readdir($dh))
{
$filepath = $dir.$filename;
if(is_file($filepath) and ereg("\.jpg$",$filename))
{
$gallery[] = $filepath;
$fnarray[] = $filename;
$count++;
}
}