Source for file unserializeObject.php
Documentation is available at unserializeObject.php
* This example shows how XML_Serializer and XML_Unserializer
* A structure is serialized and later it's unserialized from the
* resulting XML document.
* @author Stephan Schmidt <schst@php.net>
require_once 'XML/Serializer.php';
require_once 'XML/Unserializer.php';
// this is just to get a nested object
$pearError = PEAR ::raiseError ('This is just an error object',123 );
$foo->value = 'My value';
$foo->error = $pearError;
$foo->xml = array ('This is' => 'cool');
$foo->resource = fopen(__FILE__ , 'r');
$xml = $serializer->getSerializedData ();
// be careful to always use the ampersand in front of the new operator
if (PEAR ::isError ($status)) {
echo 'Error: ' . $status->getMessage ();
$data = $unserializer->getUnserializedData ();
Documentation generated on Mon, 11 Mar 2019 15:41:41 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|