Re: sorting and searching an Array

From: Date: Wed, 17 Jul 2002 20:26:16 +0000
Subject: Re: sorting and searching an Array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-108155@lists.php.net to get a copy of this message
Unless I'm missing something, why put it in an array. Why not just just select the data from the data base that matches your search_name and list it. Something like: SELECT e_mail, name FROM e_mail_file WHERE name = '$search_name' ORDER by name HTH. Dan. rdkurth@starband.net wrote:
After I read this file into an array (small sample of file below) I need to sorted it by the name at the end of each line and then echo out only the ones that the name equals the name in a search variable. Also could somebody recommend a PHP book that covers a lot of info on working with text files. It seams to be very little info in any of the boos I have now. It is sort of skipped over a lot mrgouldian@www.mrgouldian.com mrgouldian webmaster@www.mydomain.com myname info@www.mrgouldian.com mrgouldian webmaster@www.mrgouldian.com mrgouldian suport@www.mydomain.com myname fred@www.mrgouldian.com mrgouldian sales@www.mydomain.com myname info@www.mydomain.com myname gary@www.mrgouldian.com mrgouldian myname@www.mydomain.com myname


« previous php.general (#108155) next »