0

I am trying to explode file content , but it seems explode cant create array with large size of variable.

Is there any max array size for explode function?

$lines = explode ( "\n", $filecontent );
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user6618536
  • 207
  • 2
  • 3
  • 11
  • Why would you use explode against a file content, when PHP provides `file()` anyway; but just how big is this file? And the fact that you have the content in memory, and try to create an array in memory as well is going to use at least double the memory, and then some – Mark Baker Mar 02 '17 at 08:05
  • Have a look at this post : http://stackoverflow.com/questions/9276212/php-settings-memory-limits-1024m-does-not-work It might help work around your problem, although theres a finite limit on the amount of memory you can consume. – FreudianSlip Mar 03 '17 at 08:46

1 Answers1

0

if you want read file for line dont use explode you can use fread() or fgets()

itbirds
  • 9
  • 2