Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
- New php-forum User
- Posts: 28
- Joined: Sat Dec 14, 2002 9:43 am
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"?
- Last Samuray
- Posts: 831
- Joined: Sun Jun 02, 2002 3:09 am
there are no such function....
try to use regular expresions for searching string in text file...
- Posts: 830
- Joined: Tue Jan 21, 2003 10:42 pm
- Location: Michigan USA
you would need to read the file into php and use preg_match.
- Posts: 2272
- Joined: Sat Jul 05, 2003 1:18 pm
- Location: A bunk in the back
Redcircle wrote:you would need to read the file into php and use preg_match.
Or just strpos() for simple matching.
- php-forum Super User
- Posts: 1280
- Joined: Sat Mar 22, 2003 9:42 am
- Location: Mumbai, India
use the file function get the text in the array and then use array functions to search the text :idea:
Return to “PHP coding => General”
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests