Re: bad use of foreach() when building xml str from xml tree(source code provided here).

From: Date: Wed, 28 Sep 2005 20:08:36 +0000
Subject: Re: bad use of foreach() when building xml str from xml tree(source code provided here).
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-223382@lists.php.net to get a copy of this message
> $array = array('NEWSFEED' => array( > '0' => array( > 'MESSAGE' => array( > '0' => array( > 'COMMENT' => array( > '0' => array( > 'VALUE' => 'Comment #1')))), > '1' => array( > 'MESSAGE' => array( > '0' => array( > 'COMMENT' => array( > '0' => array( > 'VALUE' => 'Comment #2')))) > ))); Parse error: parse error, unexpected ';', expecting ')' in blah blah... But I fixed it this time and got the output.. Not a very good output here... --snip-- <NEWSFEED> <MESSAGE> <COMMENT> <VALUE>Comment #1</VALUE> </COMMENT> <MESSAGE> <COMMENT> <VALUE>Comment #2</VALUE> </COMMENT> </MESSAGE> </MESSAGE> </NEWSFEED> --snip-- > how did you transform the xml data into an array? See the link at http://www.devdump.com/phpxml.php . I wasn't very happy with the feature in Pear so I had to make one on my own and did some research on google where I came upon this and I'm very happy with this result. I need something that is dynamic of some sort. FletchSOD

« previous php.general (#223382) next »