Procedural directory iteration
<?php $d = opendir('/usr/local/images') or die($php_errormsg); while (false !== ($f = readdir($d))) { print $f . "\n"; } closedir($d); ?>