Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
i looked through the functions list, but i could find any function that could search something (like a phrase) in a text file. The closes i could get is fseek(), which isn't what i want. Could there be a function like "fsearch"?
- New php-forum User
- Posts: 28
- Joined: Sat Dec 14, 2002 9:43 am
there are no such function....
try to use regular expresions for searching string in text file...
- Last Samuray
- Posts: 831
- Joined: Sun Jun 02, 2002 3:09 am
you would need to read the file into php and use preg_match.
- Posts: 830
- Joined: Tue Jan 21, 2003 10:42 pm
- Location: Michigan USA
Redcircle wrote:you would need to read the file into php and use preg_match.
Or just strpos() for simple matching.
- Posts: 2272
- Joined: Sat Jul 05, 2003 1:18 pm
- Location: A bunk in the back
use the file function get the text in the array and then use array functions to search the text :idea:
- php-forum Super User
- Posts: 1280
- Joined: Sat Mar 22, 2003 9:42 am
- Location: Mumbai, India
Return to PHP coding => General
Who is online
Users browsing this forum: Google [Bot] and 2 guests