Function to load file as associate array?

From: Robert Oschler (no_replies_at_fake_email_address.invalid)
Date: 11/30/03


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.


Relevant Pages

  • Re: Function to load file as associate array?
    ... "Robert Oschler" a écrit le 30/11/2003: ... > Suppose I have a standard ASCII file with each line terminated by a line ... > I want to load the file into an associative array with the elements on the ...
    (alt.php)
  • Re: Returned XML into a JavaScript array
    ... I am getting some XML from an AJAX call and want to load it into a 2D ... I want to load it into an Associative Array like this: ... var root = xmlDoc.getElementsByTagName.item; ...
    (comp.lang.javascript)
  • Returned XML into a JavaScript array
    ... I am getting some XML from an AJAX call and want to load it into a 2D ... I want to load it into an Associative Array like this: ...
    (comp.lang.javascript)