rrobyf

Pencarian File Direktori dan SubDirektori

Dec 4th, 2013
994
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $filter = "namafile";
  3. $folder = './';
  4. $proses = new RecursiveDirectoryIterator("$folder");
  5. foreach(new RecursiveIteratorIterator($proses) as $file)
  6. {
  7.   if (!((strpos(strtolower($file), $filter)) === false) || empty($filter))
  8.   {
  9.     $tampil[] = preg_replace("#/#", "/", $file);
  10.   }
  11. }
  12. sort($tampil);
  13. print_r($tampil);
  14. ?>
RAW Paste Data