php ?
php ?
Out of context: Reply #7
- Started
- Last post
- 7 Responses
- enobrev0
well, the most efficient way to do it would be to use regular expressions, althoguh it'll take you a bit to read up on them and figure them out.
If you're interested, check out preg_match and preg_match_all, and then start looking up how to write regex patterns...
This way you wouldn't even put it all into an array. You could have preg_match return the correct lines or parts of lines accordingly
As far as searching a file split into an array, I'd say the foreach is the easiest, and shouldn't be too heavy unless you're getting a few thousand hits an hour.
Ah what the hell, here's a regex example...
code:
http://dev.enobrev.com/nt/text_s…example:
http://dev.enobrev.com/nt/text_s…Good Luck!