In PHP5 gibt es auch die Funktion scandir.
http://de3.php.net/scandir