is there a fastest and most efficient way of parsing text from a file using php's built in function?
the file contains data delimited by some character like '&' and by new lines. i use the "file" function to convert the lines into array then use foreach to read each line then use "parse_str" to get the data i need.
anyone have a faster way of doing this or dealing with such? thanks.
I don't usually use file. I usually read line by line and process that way. As with most parsing tasks, you have to be familiar with the type and amount of data to be sure that your method is the most efficient.
Most of my parsers are for various types of logs and the amount of data can be overwhelming. I never use file because the thought of loading 500K lines into an array always makes my servers cry a little. ;)