I developed a PHP page with global variable like this;
global $amty_imgCache; $amty_imgCache = array();
$GLOBALS["amty_imgCache"]=$amty_imgCache;
This page has functions to add/delete entries to/from this array.
I called a function on antother PHP page to display its count and to put some elements into this global array this way;
Count <?php echo amty_getImageCacheCount(); ?>
<?php amty_putIntoImageCache(100,0); ?>
Count <?php echo amty_getImageCacheCount(); ?>
But on every refresh first it displays count 0 then 1.
How can I persist values of global variable across entire application.
Use APC or memcache to store such values. You can not only access these values from any page but can also access from any server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With