note 90236 rejected from simplexml.examples by danbrown
| From: | danbrown@php.net | Date: | Sat, 11 Apr 2009 19:53:02 +0000 |
| Subject: | note 90236 rejected from simplexml.examples by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153094@lists.php.net to get a copy of this message | ||
Note Submitter: bagherozzo21 at tiscali dot it
----
Hi all,
I am going mad!, I have to read an XML file and everything if fine except when I have to read a tag
that contains <!CDATA[
this is the tag:
<Description>
<![CDATA[<p>In a totally refurbished apartment building. We offer you this
furnished 1 bedroom (loft) apartment (86m2) with elevator and storage room in basement. Entrance;
hall, toilet, luxury new kitchen, one bedroom, bathroom with toilet, shower and washing machine
connection. On the Mercatorplein you will find shops and restaurants. This area is served by: tram
line(s) 7, 13. It is 15 minutes to Sloterdijk Station, 20 minutes to Central Station. Also
it&rsquo;s close to ring A10. Parking is possible, garage &euro; 112,50 per month.
<br /><br />&nbsp;</p>]]>
</Description>
and if print ( $item->Description);
its content is empty!!
If I do
print($item->Description->asXML());
I can see:
<![CDATA[<p>In a totally refurbished apartment building. We offer you this
furnished 1 bedroom (loft) apartment (86m2) with elevator and storage room in basement. Entrance;
hall, toilet, luxury new kitchen, one bedroom, bathroom with toilet, shower and washing machine
connection. On the Mercatorplein you will find shops and restaurants. This area is served by: tram
line(s) 7, 13. It is 15 minutes to Sloterdijk Station, 20 minutes to Central Station. Also
it&rsquo;s close to ring A10. Parking is possible, garage &euro; 112,50 per month.
<br /><br />&nbsp;</p>]]>
but than I do not how remove the CDATA tag,
I have tried by doing that
$tags = array("<![CDATA[", "]]>");
$notags = array("", "");
$description = str_replace($tags, $notags, $a);
but doesn't work.....
Please any suggestion will be appreciate!!
Cheers