Searching in a text file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ShadowWolf
Forum Newbie
Posts: 1
Joined: Wed Nov 12, 2008 3:18 am

Searching in a text file

Post by ShadowWolf »

Ok, I have a php file which insert in a txt file values entered by a user through some forms. What I need to do now is to perform a search through this text file and come up with every string that matches the results.
Example:
Text File Content

Daniel Shepard 23 Abbey Road London Student
Mike Harris 43 Downing Street London Bricklayer
Diane Mulder 32 Downing Street London Teacher

If I write Downing Street in the search form it should give me

Mike Harris 43 Downing Street London Bricklayer
Diane Mulder 32 Downing Street London Teacher

What Can I Do? I tried to read documentation on php.net, but I didn't come up with the soluton. Thanks in Advance.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Searching in a text file

Post by aceconcepts »

User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Searching in a text file

Post by VladSun »

There are 10 types of people in this world, those who understand binary and those who don't
Post Reply