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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> $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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux