I would like to know which is the fastest way to find a string in a file using PHP. I have been told than the quickest way to read a file was using file() function, but to find a string in the whole file I will have to do a foreach. Whereas if I use file_get_contents or something, I just have to do a str_pos() on the file.
