note 120171 added to function.simplexml-load-string
| From: | orrd | Date: | Tue, 15 Nov 2016 19:29:45 +0000 |
| Subject: | note 120171 added to function.simplexml-load-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-207112@lists.php.net to get a copy of this message | ||
There is an old comment from many years ago that suggests adding a method for retrieving a specific
attribute, but there is already a simpler way to do it.
This is an example of how you get the value of a specific attribute:
<?php
$xml = simplexml_load_string('<xml>
<dog type="poodle" owner="Mrs Smith">Rover</dog>
</xml>');
echo $xml->dog->attributes()->type;
?>
----
Server IP: 72.52.91.14
Probable Submitter: 2602:302:d127:d850:b5c2:c3aa:8b12:6cb1
----
Manual Page -- http://php.net/manual/en/function.simplexml-load-string.php
Edit -- https://master.php.net/note/edit/120171
Del: integrated -- https://master.php.net/note/delete/120171/integrated
Del: useless -- https://master.php.net/note/delete/120171/useless
Del: bad code -- https://master.php.net/note/delete/120171/bad+code
Del: spam -- https://master.php.net/note/delete/120171/spam
Del: non-english -- https://master.php.net/note/delete/120171/non-english
Del: in docs -- https://master.php.net/note/delete/120171/in+docs
Del: other reasons-- https://master.php.net/note/delete/120171
Reject -- https://master.php.net/note/reject/120171
Search -- https://master.php.net/manage/user-notes.php