List contents of a directory
August 21st, 2005 by SubZane
A quick and dirty way to list the contents of a directory. You might want to add more properties to it for displaying only certain file types and so on. I might post that later on.
PHP:
And how to use it:
PHP:
-
$arr = dirList("./");
-
for ($i=0; $i<count ($arr); $i++) {
-
}
You are missing the closing . As well, how do you think you would add filesize to this in a friendly manner?
That last message should have said the close A HREF tag, but the html catcher removed the a.
thanks for the heads-up on the a-href tag. Try using the filesize() method for retreiving filesize for the files.