note 58199 added to function.simplexml-element-children
| From: | Sebastian at osu1 dot php dot net | Date: | Thu, 27 Oct 2005 10:45:49 +0000 |
| Subject: | note 58199 added to function.simplexml-element-children | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-97680@lists.php.net to get a copy of this message | ||
Just a quick addition:
If you need to access a child node which contains a dash, you need to encapsulate it with
{""}.
For example:
<?php
foreach ($domain->domain-listing as $product) {
}
?>
The example above doesn't work because of the dash. But instead you need to use:
<?php
foreach ($domain->{"domain-listing"} as $product) {
}
?>
At least for me the second example works perfectly fine.
----
Manual Page -- http://www.php.net/manual/en/function.simplexml-element-children.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58199
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58199&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58199&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58199&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58199&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58199&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58199&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58199&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58199&report=yes
Search -- http://master.php.net/manage/user-notes.php