*/
error_reporting(E_ALL);
// this is a simple XML document
$xml = '
'; print_r($data); echo ''; } // unserialize it again and change the complexType option // but leave other options untouched // now complex types will be an object, and the property name will be in the // attribute 'handle' $status = $unserializer->unserialize($xml, false, array(XML_UNSERIALIZER_OPTION_COMPLEXTYPE => 'object')); if (PEAR::isError($status)) { echo 'Error: ' . $status->getMessage(); } else { $data = $unserializer->getUnserializedData(); echo '
'; print_r($data); echo ''; } // unserialize it again and change the complexType option // and reset all other options // Now, there's no key so the tags are stored in an array $status = $unserializer->unserialize($xml, false, array(XML_UNSERIALIZER_OPTION_OVERRIDE_OPTIONS => true, XML_UNSERIALIZER_OPTION_COMPLEXTYPE => 'object')); if (PEAR::isError($status)) { echo 'Error: ' . $status->getMessage(); } else { $data = $unserializer->getUnserializedData(); echo '
'; print_r($data); echo ''; } ?>