note 76201 added to ref.simplexml

From: Date: Thu, 05 Jul 2007 01:23:10 +0000
Subject: note 76201 added to ref.simplexml
Groups: php.notes 
Request: Send a blank email to php-notes+get-128235@lists.php.net to get a copy of this message
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 ) ---- Server IP: 203.202.10.60 Probable Submitter: 202.44.175.177 ---- Manual Page -- http://www.php.net/manual/en/ref.simplexml.php Edit -- https://master.php.net/note/edit/76201 Del: integrated -- https://master.php.net/note/delete/76201/integrated Del: useless -- https://master.php.net/note/delete/76201/useless Del: bad code -- https://master.php.net/note/delete/76201/bad+code Del: spam -- https://master.php.net/note/delete/76201/spam Del: non-english -- https://master.php.net/note/delete/76201/non-english Del: in docs -- https://master.php.net/note/delete/76201/in+docs Del: other reasons-- https://master.php.net/note/delete/76201 Reject -- https://master.php.net/note/reject/76201 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128235) next »