How To List All Files In A Directory Using Php
RegisterLogin
How To List All Files In A Directory Using Php
Post Description: how to list all files in a directory using php
Tags: how, to, list, all, files, in, a, directory, using, php
This Post Was Posted On Oct 06, 2010 By Telmeasr #3566
Post Description: how to list all files in a directory using php
Tags: how, to, list, all, files, in, a, directory, using, php
This Post Was Posted On Oct 06, 2010 By Telmeasr #3566
How To List All Files In A Directory Using Php by Telmeasr
for example, lets say i have a directory tree like this:
./fruits
oranges.php
grapes.php
bananas.php
apples.php
as you can see i want to be able to get all these php files from code
does anyone know how about getting and listing all the current files from a folder?
thanks
Leave Your Comments
sanders
#4509 1
you using this code:
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file<br>";
}
}
closedir($handle);
}
you can learn more at the php.net site: http://php.net/manual/en/function.readdir.php
Oct 06, 2010 Reply Report abuse
©2012 Webune Forums - Wed Dec 12, 2012 7:22 pm
Powered by: Webune Forums V3
Powered by: Webune Forums V3