Why do both the explode and preg_split functions eat up the available 32MG of memory on my server resulting in a Fatal error? Kinda crazy that it does. (I un-commented the explode and got same error.) The data has a lot of Unicode non-English chars.
Output:
len of filecontents=2767569
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 16 bytes) in /var/ on line 57
Code:
$len = mb_strlen($FileContents);
echo '<br> len of filecontents=' . $len;
// $SignificantPlaceNames = explode("\n", $FileContents); // stupid explode kills memory
$SignificantPlaceNames = preg_split("/[\s,]+/", $FileContents);
Output:
len of filecontents=2767569
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 16 bytes) in /var/ on line 57