List files and directories in a folder in php - PHP Views : 256
Tagged in : PHP
0 0
Send mail
we can list files and directories inside a folder or file path using the function scandir

scandir — List files and directories inside the specified path

Returns an array of files and directories from the directory .

$dir = "./temp";
$files = scandir($dir);
print_r($files);

Example output

Array
(
[0] => .
[1] => ..
[2] => filename1
[3] => filename2
)




By rajesh, On - 2010-01-02



    Login to add Comments .