kushal33

php script to listout only directories of specific folder

Feb 1st, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.19 KB | None | 0 0
  1. <?php
  2. $dir = array_diff(scandir("./"), array('..', '.'));
  3. foreach ($dir as $key => $value) {
  4.     if(is_dir($value)) 
  5.     {
  6.             $folder[]=$value;
  7.     }
  8. }
  9. echo json_encode($folder);
  10. ?>
Add Comment
Please, Sign In to add comment