I would like to save from 0 to ~ 5000 IP addresses in a text file with an unbound header at the top. Something like that:
Unrelated data
Unrelated data
----SEPARATOR----
1.2.3.4
5.6.7.8
9.1.2.3
Now I would like to find if "5.6.7.8" is in this text file using PHP. I only ever downloaded the whole file and processed it in memory, but I wondered if there was a more efficient way to search for a text file in PHP. I only need true / false if it is there.
Can anyone shed some light? Or would I be stuck with downloading in the whole file first?
Thanks in advance!
source
share