Hey Darren,
You may want to try this :
<?php
function getImages($dir)
{
if ( is_dir($dir) ) {
$fd = opendir($dir);
while ( ( $part = @readdir($fd)) == TRUE ) {
clearstatcache();
if ( eregi("(gif|jpg|png|jpeg)$",$part) ) {
$my_images[] = $part;
}
}
Return $my_images;
} else {
Return ' This : <b>' . $dir . '</b> is not a directory for getImages() ';
}
}
// Here's an example use :
$array_of_images = getImages('/path/to/images/dir/');
?>
It should make sense. It will only stick designated image types (gif|jpg|png|jpeg) into the array so any file can be in the directory. It's another option at least (read: may be overkill), use and modify as you wish.
Philip