Re: [PHP] SimpleXML: convert xml to text

[email protected] (Dasn)
Newsgroups php.general
Organization G
Message-ID <op.u9k32cq1iztdz5@bla>
On Sun, 14 Mar 2010 22:02:22 +0800, Ashley Sheridan wrote:

> On Sun, 2010-03-14 at 21:58 +0800, Dasn wrote:
>
>> Hello, I want to convert some xml stuff to simple string using php, say:
>>
>> <?php
>>
>> $string = <<<XML
>> <a> left <foo>center1<ok>ok</ok>center2</foo>right </a>
>> XML;
>>
>> $xml = simplexml_load_string($string);
>> echo $xml;
>> ?>
>> The code will output "left right" while all the central stuff was lost.
>> How should I print it as "left center1 ok center2 right" ?
>>
>> Thanks in advance, and please Cc me. :)
>>

Well I change to use xmlparser instead, never mind. :)

-- 
Dasn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.