Need an array-like structure in PHP with minimal memory usage

后端 未结 8 2207
星月不相逢
星月不相逢 2020-12-23 02:02

In my PHP script I need to create an array of >600k integers. Unfortunately my webservers memory_limit is set to 32M so when initializing the array the script a

8条回答
  •  借酒劲吻你
    2020-12-23 02:43

    600K is a lot of elements. If you are open to alternative methods, I personally would use a database for that. Then use standard sql/nosql select syntax to pull things out. Perhaps memcache or redis if you have an easy host for that, such as garantiadata.com. Maybe APC.

提交回复
热议问题