06-03-2010, 11:30 AM
|
#4 (permalink)
|
|
The Prestige
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
|
We could also use PHP's SPL objects, namely the DirectoryIterator, which as the name suggests, does just that!
PHP Code:
try { foreach ( new DirectoryIterator('.') as $pItem ) { if($pItem->isFile() || $pItem->isDot()) { continue; } echo $pItem . '<br />'; } } catch(Exception $e) { echo $e->getMessage(); }
Yea the documentation isn't the greatest in for the SPL stuff, its a shame coz most of it is hot stuff!
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
|
|
|
|