note 60398 deleted from function.simplexml-element-asxml by tularis
| From: | tularis@php.net | Date: | Sat, 07 Jan 2006 09:33:35 +0000 |
| Subject: | note 60398 deleted from function.simplexml-element-asxml by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-101342@lists.php.net to get a copy of this message | ||
Note Submitter: laraxpl at wp dot pl
----
There is a little mistake in example. Code like this:
$string = "<test> Something </test>";
$xml = simplexml_load_from_string($string);
echo $xml->asXML();
won't output "<test> Something </test>"
but just "Something"
It's because echo function takes "<" and ">" as html tags. You need
to use htmlspecialchars() function to output it correctly.