nkline
05-02-2006, 03:58 PM
Greetings,
I'm aware PHP can read the entire contents of a file into a string then from there it's possible to search that string for some data.
And I'm also aware that PHP can read the entire contents of a file into an array then from there it's possible to search that array for some data.
But can PHP search a file (such as a .txt or .html file) for a string of data?
If not, then I guess I'm stuck with the first two options I listed. In that case, lets say I have a .txt file with a bunch of text in it. I want to locate a specific phrase within that text file. Is it more efficient (faster results) to read the contents of that .txt file into a string or an array? Then perform the search.
Thanks in advance,
*Nick*
I'm aware PHP can read the entire contents of a file into a string then from there it's possible to search that string for some data.
And I'm also aware that PHP can read the entire contents of a file into an array then from there it's possible to search that array for some data.
But can PHP search a file (such as a .txt or .html file) for a string of data?
If not, then I guess I'm stuck with the first two options I listed. In that case, lets say I have a .txt file with a bunch of text in it. I want to locate a specific phrase within that text file. Is it more efficient (faster results) to read the contents of that .txt file into a string or an array? Then perform the search.
Thanks in advance,
*Nick*