PHP中数组的最大大小是多少?

时间:2022-06-29 21:26:17

We like to store database values in array. But we do not know the maximum size of an array which is allowed in PHP?

我们喜欢将数据库值存储在数组中。但是我们不知道PHP中允许的数组的最大大小?

2 个解决方案

#1


32  

There is no max on the limit of an array. There is a limit on the amount of memory your script can use. This can be changed in the 'memory_limit' in your php.ini configuration.

数组的极限没有最大值。您的脚本可以使用的内存数量是有限制的。这可以在php的“memory_limit”中更改。ini配置。

#2


12  

Array size is limited only by amount of memory your server has. If your array gets too big, you will get "out of memory" error.

数组大小仅受服务器的内存数量限制。如果数组太大,就会出现“内存不足”错误。

#1


32  

There is no max on the limit of an array. There is a limit on the amount of memory your script can use. This can be changed in the 'memory_limit' in your php.ini configuration.

数组的极限没有最大值。您的脚本可以使用的内存数量是有限制的。这可以在php的“memory_limit”中更改。ini配置。

#2


12  

Array size is limited only by amount of memory your server has. If your array gets too big, you will get "out of memory" error.

数组大小仅受服务器的内存数量限制。如果数组太大,就会出现“内存不足”错误。