note 77868 added to function.simplexml-load-string
| From: | hattori at hanso dot com | Date: | Mon, 17 Sep 2007 09:15:12 +0000 |
| Subject: | note 77868 added to function.simplexml-load-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130547@lists.php.net to get a copy of this message | ||
If you want to serialize and unserialize SimpleXMLElement objects for caching, you need to transform
the SimpleXMLElement object into a standard class object before unserializing.
This is only if you want to cache converted data, the functionallity of the SimpleXMLElement will
not be held.
$content = '<SomeXML....'
$serialized = str_replace(
array('O:16:"SimpleXMLElement":0:{}',
'O:16:"SimpleXMLElement":'),
array('s:0:"";', 'O:8:"stdClass":'),
serialize(simplexml_load_string($content))
);
$unserialized = unserialize($serialized);
----
Server IP: 194.145.210.3
Probable Submitter: 217.110.247.50
----
Manual Page -- http://www.php.net/manual/en/function.simplexml-load-string.php
Edit -- https://master.php.net/note/edit/77868
Del: integrated -- https://master.php.net/note/delete/77868/integrated
Del: useless -- https://master.php.net/note/delete/77868/useless
Del: bad code -- https://master.php.net/note/delete/77868/bad+code
Del: spam -- https://master.php.net/note/delete/77868/spam
Del: non-english -- https://master.php.net/note/delete/77868/non-english
Del: in docs -- https://master.php.net/note/delete/77868/in+docs
Del: other reasons-- https://master.php.net/note/delete/77868
Reject -- https://master.php.net/note/reject/77868
Search -- https://master.php.net/manage/user-notes.php