Guest User

Untitled

a guest
Oct 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. $path = public_path().'/root';
  2. $files = array();
  3. $folders = array();
  4.  
  5. if (is_dir($path)) {
  6. $dirhandle = opendir($path);
  7. while (($dir = readdir($dirhandle)) !== false) {
  8. if(is_dir($dir) && $dir!= "." && $dir!= "..") {
  9. $folders[] = $dir;
  10. }
  11. else if(is_file($dir)) {
  12. $files[] = $dir;
  13. }
  14. }
  15. closedir();
  16. }
  17. return $folders;`
Add Comment
Please, Sign In to add comment