note 76201 deleted from ref.simplexml by danbrown
| From: | danbrown@php.net | Date: | Mon, 18 May 2009 01:20:21 +0000 |
| Subject: | note 76201 deleted from ref.simplexml by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155521@lists.php.net to get a copy of this message | ||
Note Submitter: mail at jezz dot dk
----
Correct me if I'm wrong, but I think the output of the SimpleXMLElement Object is dependent on
the PHP version. Consider this code:
$xml = '<edition id="20070705" onsale="2007-07-06"
online="2007-07-06 09:00">
<headline maxchars="50">The new issue</headline>
</edition>';
$res = simplexml_load_string($xml);
print("<pre>");
print_r($res);
print("</pre>");
PHP version 5.0.4 will return this:
SimpleXMLElement Object
(
[headline] => The new issue
)
While PHP version 5.2.1 returns (some) attributes as well:
SimpleXMLElement Object
(
[@attributes] => Array
(
[id] => 20070705
[onsale] => 2007-07-06
[online] => 2007-07-06 09:00
)
[headline] => The new issue
)