I developed a PHP page with global variable like this;
global $amty_imgCache; $amty_imgCache = array();
$GLOBALS[\"amty_imgCache\"]=$amty_imgCache;
>
You got something wrong.
All variables in php outside a function or class are global variables!
To use a global variable in a function and change its value use global-Keyword in the function
$amty_imgCache = array();
$amty_imgCache[] ="my_first_img.png";
function amty_getImageCacheCount() {
global $amty_imgCache;
echo "count is:" ,count($amty_imgCache);
}
But this storage is only per one request. If you want to store things longer use a session or a database or a file