04-09-2009, 11:38 AM
|
#12 (permalink)
|
|
The Frequenter
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
|
Quote:
Originally Posted by sketchMedia
we can condense it further with the SPL DirectoryIterator:
PHP Code:
$directory = './';
$pDir = new DirectoryIterator($directory);
foreach($pDir as $fInf)
{
if($fInf->isDot()) { continue; }
if($fInf->isDir())
{
echo '<strong>', $fInf->getFilename() , '</strong><br />';
}
else
{
echo $fInf->getFilename() , '<br />';
}
}
|
*Hint* The SPL docs at php.net could need a hand =)
__________________
|
|
|