|
|
List files and directories in a folder in php - PHP
|
Views : 256
|
|
Tagged in : PHP
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
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 |
|
|
|