Forum Moderators: coopster

Message Too Old, No Replies

How do I get the contents of a folder?

         

Jacob or JaF

8:15 pm on Aug 17, 2006 (gmt 0)

10+ Year Member



I want to put the contents of a folder into an array.

Say a folder called data has index.php and text.txt in it.
Now I code $files=get_contents_of_folder('data'), and that makes this: $files[0]='index.php' and $files='text.txt'.

Please help.

[1][edited by: Jacob_or_JaF at 8:27 pm (utc) on Aug. 17, 2006]

Jacob or JaF

8:22 pm on Aug 17, 2006 (gmt 0)

10+ Year Member



Also, how do I get the number of files in a folder?

jatar_k

9:45 pm on Aug 17, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try this search for many relevant threads

list files in a directory [google.com]