Purpose:
Generate thumbnail gallery from specific folders
Usage Example:
/*import library*/
require_once('libs/php_gallery.php');
/*initial object - with path to your folder*/
$php_gallery = new PHP_Gallery('./gallery/');
/*
* If set cache = true. After scan folder, this script will generate a file(default name: gallery.json) with all images data.
* This file (gallery.json) need remove when new image uploaded
*/
$php_gallery->setCache(true);
/*Set of images in your folder*/
$images = $php_gallery->getImages();
/*Print out the $images variable*/
print_r($images);
Output:
Array
(
[1] => Array
(
[src] => path/to/image
[thumbnail] => path/to/thumbnail
[title] => Your Title
[description] => Your Description
[url] => http://example.com
)
[2] => Array
(
[src] => path/to/image
[thumbnail] => path/to/thumbnail
[title] => Your Title
[description] => Your Description
[url] => http://example.com
)
...
)