Advertisement
DynamicDonut

EinSynd's scandir php

May 14th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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