Looking at files within a folder...
<?php $handle = opendir('./sub'); while(false !== ($file = readdir($handle))){ echo "$file<br />"; } closedir($handle); ?>