Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working with huge text files in PHP?

I need to scan through a 30MB text file - it's a list of world cities - How can I access this file, I feel like a File_Get_Contents will give my server a stroke

like image 744
Graham Avatar asked Jan 24 '26 08:01

Graham


1 Answers

Just fopen it and then use fgets.

like image 200
Daniel Lubarov Avatar answered Jan 26 '26 21:01

Daniel Lubarov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!