Advertisement
Guest User

PHP directory list

a guest
May 13th, 2018
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. <?php
  2.     $dir = "./projTest";
  3.     $projList = scandir($dir, SCANDIR_SORT_NONE);
  4.    
  5.     //Remove . and ..
  6.     unset($projList[0]);
  7.     unset($projList[1]);
  8.    
  9.     $jsonArr = join("\",\"", $projList);
  10.    
  11.     echo "[\"" . $jsonArr . "\"]";
  12. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement