How many number of elements can an array in PHP hold? like 300? 10000? or
10000000000000000000000000000000000000000000000000000000 ???

Recommended Answers

All 2 Replies

I dont' think there is a limit:
but consider: an array can contain strings and/or ints, a string max lenght is ~2GB, the int limit is platform dependent, default is two billions.

So the array will probably be limited by the memory_limit in php.ini or by the amount of RAM.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.