note 53638 modified in ref.simplexml by danbrown
| From: | danbrown@php.net | Date: | Mon, 18 May 2009 01:26:54 +0000 |
| Subject: | note 53638 modified in ref.simplexml by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155538@lists.php.net to get a copy of this message | ||
after wondering around some time, i just realized something (maybe obvious, not very much for me).
Hope helps someone to not waste time as i did :-P
when you have something like:
<?php
$xmlstr = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<double xmlns="http://foosite.foo/">2328</double>
XML;
?>
you will have the simpleXML object "transformed" to the text() content:
<?php
$xml = simplexml_load_string($xmlstr);
echo $xml; // this will echo 2328 (string)
?>
--was--
after wondering around some time, i just realized something (maybe obvious, not very much for me).
Hope helps someone to not waste time as i did :-P
when you have something like:
$xmlstr = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<double xmlns="http://foosite.foo/">2328</double>
XML;
you will have the simpleXML object "transformed" to the text() content:
$xml = simplexml_load_string($xmlstr);
echo $xml; // this will echo 2328 (string)
http://php.net/manual/en/ref.simplexml.php