Re: Getting variables from a text file
| From: | Girish Nath | Date: | Tue, 05 Feb 2002 15:53:06 +0000 |
| Subject: | Re: Getting variables from a text file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-83598@lists.php.net to get a copy of this message | ||
Hi
It looks like a querystring, so read the contents of the file into a variable, then use the
parse_str() function on that variable, you can specify if you want them to be stored in an array
too.
http://www.php.net/manual/en/function.parse-str.php
Regards
Girish
--
www.girishnath.co.uk
----- Original Message -----
From: David Orn Johannsson
To: php-general@lists.php.net
Sent: Tuesday, February 05, 2002 2:50 PM
Subject: [PHP] Getting variables from a text file
I have this text file I have to retreve infromation from, in the fallowing format:
date1=1/1/2002&title1=some title&headline1=some headline&full1=full
article&date2=2/1/2002&title2=some title&.... and so on
what would be the best thing for me to do to if I was to get the values of all the
"variables" of the text file into a php document as variables.
Regards, David
------------------------
Davíð Örn Jóhannssson
Vefforritari
------------------------
Atómstöðin hf.
Garðastræti 37
101 Reykjavík
------------------------
sími: 595-3643
fax: 595-3649
david@atom.is
http://www.atom.is
------------------------