Posted by Geoff Berrow on 12/08/06 13:51
Message-ID: <k0qin25f9pbn22f1ui1dnc3guk7enuio0t@4ax.com> from H@C0
contained the following:
>I am using a flat file database like:
>
>London || Bill F. || email-1
>Paris || Pierre E. || email-2
>Berlin || Hans K. || email-3
>London || Harry W. || email-4
>Madrid || Juan G. || email-5
>
>I only want the records being displayed of the city of London (field1),
>not using a search command.
Don't know what you mean about not using a search command.
Something like this will display all records containing "London"
$search="London";
$data=file("data.txt");
foreach ($data as $row){
$field=explode("||",$row);
if(strpos($field[0],$search)!==false){
echo $row,"<br>";
}
unset($field);
}
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
[Back to original message]
|