foreach (glob("images/*.*") as $filename) {
echo basename($filename);
}
Wednesday, October 28, 2009
List all the files in a directory in php
This code will display all the files in the images folder.
Subscribe to:
Post Comments (Atom)

I'm started following u ,i'm pleased that u also do the same,Plz follow my blog www.winingdesire.blogspot.com
ReplyDeleteIn this post you have used glob() function? Can you give me a little bit details about that.
ReplyDeleteAnd it would be good if you can explain the each line of code.
Thanks.
Shaharia Azam
http://www.shahariaazam.com
Nice one, didn't known that. How did you come up with this solution?
ReplyDelete