Function to load file as associate array?
From: Robert Oschler (no_replies_at_fake_email_address.invalid)
Date: 11/30/03
- Next message: Janwillem Borleffs: "Re: mail() Bcc?"
- Previous message: Michael Fuhr: "Re: seems to be working now..."
- Next in thread: Janwillem Borleffs: "Re: Function to load file as associate array?"
- Reply: Janwillem Borleffs: "Re: Function to load file as associate array?"
- Reply: Jedi121: "Re: Function to load file as associate array?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 Nov 2003 16:51:35 GMT
Suppose I have a standard ASCII file with each line terminated by a line
feed, that looks like this:
field1=red
field2=30
field3=john
I want to load the file into an associative array with the elements on the
left-hand of the assignment statement being the keys.
Is there a function that does this in one shot, or do I have to load the
file using something like file() and parse it myself into an associative
array?
thx
-- Robert Oschler http://www.dog-images.com -- Devoted to providing free info on the health, nutrition, and training of dogs.
- Next message: Janwillem Borleffs: "Re: mail() Bcc?"
- Previous message: Michael Fuhr: "Re: seems to be working now..."
- Next in thread: Janwillem Borleffs: "Re: Function to load file as associate array?"
- Reply: Janwillem Borleffs: "Re: Function to load file as associate array?"
- Reply: Jedi121: "Re: Function to load file as associate array?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|