Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / examples / grid / get-images.php
diff --git a/examples/grid/get-images.php b/examples/grid/get-images.php
new file mode 100644 (file)
index 0000000..e84aaa3
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+$dir = "images/thumbs/";
+$images = array();
+$d = dir($dir);
+while($name = $d->read()){
+    if(!preg_match('/\.(jpg|gif|png)$/', $name)) continue;
+    $size = filesize($dir.$name);
+    $lastmod = filemtime($dir.$name)*1000;
+    $images[] = array('name'=>$name, 'size'=>$size,
+                       'lastmod'=>$lastmod, 'url'=>$dir.$name);
+}
+$d->close();
+$o = array('images'=>$images);
+echo json_encode($o);