What's the maximum number of keys for an array in php

后端 未结 10 1619
一整个雨季
一整个雨季 2021-02-08 03:32

I\'m writing a php script where I call

$lines = file(\'base_list.txt\');

to break a file up into an array. The file has over 100,000 lines in

10条回答
  •  旧巷少年郎
    2021-02-08 04:17

    I'm gonna agree with Cory. I'm thinking your PHP is probably configured default memory of 8MB, which 4MB x 2 is already more. The reason for the x2 is because you have to load the file, then to create the array you need to have the file in memory again. I'm just guessing, but that would make sense.

    Are you sure PHP isn't logging an error?

提交回复
热议问题