View Single Post
Old 04-09-2009, 11:38 AM   #12 (permalink)
Kalle
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

Quote:
Originally Posted by sketchMedia View Post
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 =)
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote