PDA

View Full Version : PHP Get Rid of Directory Dots!!!



drummer392
November 25th, 2009, 05:09 PM
Does anyone know how to get rid of the annoying directory dots "." and ".."

I can't seem to understand any codes I have seen on any websites.


Thanks!

icio
November 25th, 2009, 07:28 PM
Just add in a couple of redundant `readdir` calls:

$dir = opendir($path);
readdir($dir);
readdir($dir);
//... continue as normalHope that helps :thumb:

Important Edit: What you've asked for is in the second example of the PHP manual: http://uk3.php.net/readdir (RTFM)