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" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Use the explode() function based on the colon
If the file is of a reasonable size (not hundreds of kilobytes), then you
can just slurp it all into an array and foreach through it:
$matched = 0;
$myfile = file('/usr/home/crud/myfile');
foreach ($myfile as $line)
{
$split_line = explode(':', $line);
if ($split_line[1] == 'bob'
ok I believe I follow you on that, I will give that a try. But the
question I have now is how do I loop that request?
Gaylen Fraley wrote:
>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
>tha
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.
(Assume $file_row is the row name that you have assigned)
/*
4 matches
Mail list logo