Question

The title tells everything, can i change the limit of a strings length? I've checked this Page on stackoverflow, and it only tells that there is a limit, but how can i change it?

I've tried changing the memory limit using PHP like this:

ini_set('memory_limit', '-1');

But it didn't work...

Was it helpful?

Solution

From the documentation:

Note: string can be as large as up to 2GB (2147483647 bytes maximum)

and also:

The string in PHP is implemented as an array of bytes and an integer indicating the length of the buffer. It has no information about how those bytes translate to characters, leaving that task to the programmer.

That integer is probably the limit.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top