note 114696 rejected from simplexmlelement.tostring by salathe
| From: | salathe@php.net | Date: | Mon, 24 Mar 2014 14:47:02 +0000 |
| Subject: | note 114696 rejected from simplexmlelement.tostring by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-199038@lists.php.net to get a copy of this message | ||
Note Submitter: sabev dot borislav at gmail dot com
----
This is an internal method that one cannot call. However all that one needs to do is to Typecast the
SimpleXMLElement to a string and it will call it internaly:
<?php
$xml = simple_xml_load_string('<items><item><title>This is title
1</title></item></items>');
$foo = (string) $xml->items->item->title;
?>
The documentation DOES NOT mention this.