How to set a global variable accessible throughout the application

前端 未结 7 1751
失恋的感觉
失恋的感觉 2021-01-13 04:20

I developed a PHP page with global variable like this;

global $amty_imgCache; $amty_imgCache = array();
$GLOBALS[\"amty_imgCache\"]=$amty_imgCache;
         


        
7条回答
  •  长情又很酷
    2021-01-13 04:54

    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.

提交回复
热议问题