note 120171 deleted from function.simplexml-load-string by cmb
| From: | cmb@php.net | Date: | Sun, 15 Dec 2019 10:13:45 +0000 |
| Subject: | note 120171 deleted from function.simplexml-load-string by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213532@lists.php.net to get a copy of this message | ||
Note Submitter: orrd
----
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;
?>