note 103235 modified in simplexmlelement.attributes by danbrown
| From: | danbrown@php.net | Date: | Mon, 04 Apr 2011 14:25:53 +0000 |
| Subject: | note 103235 modified in simplexmlelement.attributes by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-178479@lists.php.net to get a copy of this message | ||
If you want to save the value of an attribute into an array, typecast it to a string.
<?php
// stores an xml-element-object
$dataStore['value'] = $attributes->myValue
// stores the value of the attribute
$dataStore['value'] = (string)$attributes->myValue
?>
--was--
If you want to save the value of an attribute into an array, typecast it to a string.
// stores an xml-element-object
$dataStore['value'] = $attributes->myValue
// stores the value of the attribute
$dataStore['value'] = (string)$attributes->myValue
http://php.net/manual/en/simplexmlelement.attributes.php