Forum Moderators: coopster
Can anyone please help me regarding this issue. I have a text file having more than 10000 records in it. My problem is that when I open the text file through php and read, it is taking lot of time and my system hangs up. Sometimes max execution time error also is giving. Is there any solution to give a better performance for this. I have used file("filename") to read and storing them in an array for calculations like no of counts etc..
Any help is really appreciated.
Thanks
Babloo
For as long as you must keep to the current text-file alternative, you can try
ini_set('max_execution_time', 90); at the beginning of your script (won't work if your host is in safe mode). This will increase that max execution time to 90 seconds - and if this isn't enough, you can increase this value to what's needed (and not likely to get you or your server in trouble).
It's also possible with fread to only read your file only up to a given length, but this is likely to complicate things, and if you have to process the whole bit anyways, it might not help.