note 52682 added to ref.simplexml
| From: | cyberlot at cyberlot dot net | Date: | Mon, 09 May 2005 20:24:41 +0000 |
| Subject: | note 52682 added to ref.simplexml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89175@lists.php.net to get a copy of this message | ||
outping a SimpleXML object is deceptive
For example
<doc channel="chat"><mess>Hello</mess></doc>
print_r returns
SimpleXMLElement Object
(
[mess] => Hello
)
One might assume you are "losing" the attribute of doc BUT
echo $object['channel']
Does return the value of chat
No xpath /doc/@channel mess needed to access it, Its there you just can't "see" it
until you access it directly
Everything is there, sometimes you just have to hunt for it.
----
Manual Page -- http://www.php.net/manual/en/ref.simplexml.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52682
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52682&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52682&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52682&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52682&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52682&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52682&report=yes
Search -- http://master.php.net/manage/user-notes.php