Re: Search a flat file.
| From: | Daniel Grace | Date: | Sat, 08 Jun 2002 16:58:14 +0000 |
| Subject: | Re: Search a flat file. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101288@lists.php.net to get a copy of this message | ||
Be warned that explode won't work as expected if any of your fields contain
colons, though it doesn't look like it'll be an issue in this sort of case.
"Gaylen Fraley" <gfraley5@earthlink.net> wrote in message
news:20020608031439.22982.qmail@pb1.pair.com...
> Use the explode() function based on the colon. Then parse the 2nd array
> element for the username that you want. If matched, display all elements
in
> that array row. Conversely you could use the implode() to reassemble the
> array row.
>
[...]
>
> "Tom Ray" <tom@blazestudios.com> wrote in message
> news:3D017461.6070709@blazestudios.com...
> > I want to be able to search a flat file line by line looking for data
> > such as a username then display all the information in that line. Is
> > there some way to search the following format:
> >
> > record1:username:info:info:info
> > record2:username:info:info:info
> > record3:username:info:info:info
> >