RE: [PHP-DB] Re: Urgent! Store Data In A Text File!

From: Date: Wed, 02 Jan 2002 15:01:06 +0000
Subject: RE: [PHP-DB] Re: Urgent! Store Data In A Text File!
Groups: php.db 
Request: Send a blank email to php-db+get-15305@lists.php.net to get a copy of this message
Arik, What exactly are you attempting to do? From your questions, it appears that you've stored data in fields in a line and would like to extract those data. Iin PHP, your code may look like: $fields = explode("/",$inputline); this assumes that $inputline contains something like: "lastname/firstname/street1/street2/city/state/zip/telephone" such as: "smith/john/123 main street/apt c/anytown/texas/12345-6789/972-123-4567" this would result in: $fields[0]="smith" $fields[1]="john" $fields[2]="123 main street" $fields[3]="apt c" $fields[4]="anytown" $fields[5]="texas" $fields[6]="12345-6789" $fields[7]="972-123-4567" the line $inputline would have been read from a text file. -----Original Message----- From: Jerry [mailto:jerryuk007@gmx.net] Sent: Wednesday, January 02, 2002 3:46 AM To: php-db@lists.php.net Subject: [PHP-DB] Re: Urgent! Store Data In A Text File! To retrieve data from a text file, I'm using: $fp= file("textfile.txt","r"); foreach($fp as $line) echo "- $line -"; Jerry "Arik Ashepa" <ashepa@zahav.net.il> wrote: > Can someone please tell me how can I add and retrive data from a text file I > know it has something to do with Spliting...??? > But I dont know the code... > Arik -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#15305) next »