How to list all files of a directory and its subdirectories in php?

Tuesday, November 3, 2015

How can I find all the file names of a directory or folder and its subdirectories or sub-folders.
I am using scandir(), but it returns files and subdirectory names both only from root directory.
If anybody have a solution then please suggest.



<?php
$dir = 'mydir/';
$files = scandir($dir);
?>

0 comments:

Post a Comment