How to set a global variable accessible throughout the application

前端 未结 7 1748
失恋的感觉
失恋的感觉 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 05:15

    PHP doesn't have any application-level persistence. You might want to look at Memcache for the quickest solution (if you can install it, of course).

提交回复
热议问题