Advertisement
Guest User

Untitled

a guest
May 24th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. function getAllImagesInDirectory($path) {
  2.     if ($handle = opendir($path)) {
  3.         $images = "[";
  4.         while (false !== ($file = readdir($handle))) {
  5.             if($file !== "." && $file !== "..") {
  6.                 $images .= "{image : '$path$file', title : '', url : ''},";
  7.             }
  8.         }
  9.         closedir($handle);
  10.         return substr($images,0,strlen($images)-1) . "]";
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement