Search text file
Moderator: General Moderators
Search text file
Can anyone point me on the right direction on how to search a text file for a unique value? Ive been looking for a simple tutorial but cant find one.
- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
look into fopen(), and fgets()
this will open a resource stream and fgets will feed the contents of the file into a $var
then once you have the string use eregi to search for it
and maybe if it is in the file use stripos() to find out where it is.....
best of luck...just use the manual like your best friend because it really is
this will open a resource stream and fgets will feed the contents of the file into a $var
then once you have the string use eregi to search for it
and maybe if it is in the file use stripos() to find out where it is.....
best of luck...just use the manual like your best friend because it really is