You are here: Re: [PHP] bad use of foreach() when building xml str from xml tree(source code provided here). « PHP « IT news, forums, messages
Re: [PHP] bad use of foreach() when building xml str from xml tree(source code provided here).

Posted by "Scott Fletcher" on 09/28/05 23:08

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация