Advertisement
silek65

_read_dir_00.php

Apr 17th, 2015
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <?
  2.  
  3. $files = array();
  4.  
  5. $dir = opendir('cache00/');
  6. while ($file = readdir($dir)) {
  7.     if ($file == '.' || $file == '..') {
  8.         continue;
  9.     }
  10.  
  11.     $files[] = $file;
  12. }
  13. sort($files);
  14. $a = array(
  15.         array('img' => end($files)));
  16. $json = json_encode($a);
  17. header('Content-type: application/json');
  18. //echo json_encode($json);
  19. echo json_encode(end($files));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement