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