Listing Dir of Images
Posted: Tue Jun 06, 2006 1:48 pm
I have got a directory of images and I am in the middle of listing them out but no matter how hard I try I keep getting . & .. in my array. I know I am missing something because I had this working previously in some older function I built but I need to ask the gurus what I am missing.
Thanks!
Below is my code
Thanks!
Below is my code
Code: Select all
function GetPictures($dir)
{
$picturearray=array();
if (is_dir($dir))
{
if ($dh = opendir($dir))
{
while (($file = readdir($dh)) !== false)
{
if(!strpos($file,'small_'))
{
$picturearray[]=$file;
}
}
closedir($dh);
}
}
return $picturearray;
}