Application scope in php

后端 未结 2 1488
没有蜡笔的小新
没有蜡笔的小新 2021-01-11 18:35

I need to share same array object across all requests irrespective of requests coming from same browser/user. Is there any application scope in php where I could store that

相关标签:
2条回答
  • 2021-01-11 19:17

    If you want to share it across all requests on a per user basis, using sessions is probably the way to go.

    If you want to share it across all requests of all users, you have to store it in the database, on disk or keep it in memory, e.g. using memcache or memcached.

    0 讨论(0)
  • 2021-01-11 19:17

    Some extensions, like APC or Zend Cache allow you to mimic application-scope.
    If none are available to you, you can cache the object in a file or DB.

    0 讨论(0)
提交回复
热议问题