I'm not sure if this is a php bug or server config but I can't seem to echo strings much over 2,000,000 characters in length. The page just hangs.
This works on my local machine but not on my live server.
$data = '';
for($i = 0; $i < 3000000; $i++) {
$data .= 1;
}
echo $data;
I've tried using str_split to break up the string into an array and output each portion individually but it still won't do it.
I've also seen some comments about this having to do with Nagle's Algorithm and TCP/IP buffering but I'm still none the wiser.
Please help!