How to read big file in php without being memory limit
问题 I'm trying to read a file line by line. The problem is the file was too big(over 500000 line) and I reach out the memory limit. I wonder how to read the file without being memory limit. I'm thinking about the solution multi threads(like split the file into smaller group(100000 line per group) and read it in multi threads), but I don't know how to do it in detail. Please help me(Sorry for bad English). Here is my code $fn = fopen("myfile.txt", "r"); while(!feof($fn)) { $result = fgets($fn);