note 116435 deleted from simplexml.examples-basic by cmb
| From: | cmb@php.net | Date: | Wed, 08 Jun 2022 16:29:00 +0000 |
| Subject: | note 116435 deleted from simplexml.examples-basic by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218568@lists.php.net to get a copy of this message | ||
Note Submitter: mymymymy at mymymymy dot com
----
$children = $xml->children();
var_dump($children[0]["@attributes"]);//"NULL"
var_dump($children[0]);//(2) ["@attributes"]=>array(1) {['x']=> string(1)
'2'}
no faithfully (not true)
------
example:
SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => USA
)
)
print_r($xml->country->attributes()->name);
show:
SimpleXMLElement Object
(
[0] => USA
)
print_r((string)$xml->country->attributes()->name);
show:
USA