Code: Select all
<?php
$allowedExtensions = array('.jpg', '.jpeg', '.png', '.bmp');
// $dir = "images/gage/";
$dh = opendir($dir);
$i=1;
while (($filename = readdir($dh)) !== false) {
if (is_file($dir.$filename)) {
$extension = strrchr($filename, '.');
if (in_array($extension, $allowedExtensions)) {
$image[$i]=$filename;
$i++;
}
}
}
closedir($dh);
?>This is where I am stuck