XML_Serializer
[ class tree: XML_Serializer ] [ index: XML_Serializer ] [ all elements ]

Source for file serializeEmptyArray.php

Documentation is available at serializeEmptyArray.php

  1. <?PHP
  2. /**
  3.  * This shows that XML_Serializer is able to work with
  4.  * empty arrays
  5.  *
  6.  * @author Stephan Schmidt <schst@php.net>
  7.  */
  8. require_once 'XML/Unserializer.php';
  9.  
  10. $xml = <<< EOF
  11. <autopage_options _class="autopage_options" 
  12. _type="object">
  13. <version _type="string">1.0</version>
  14. <options _type="array" />
  15. </autopage_options>
  16. EOF;
  17.  
  18. $unserializer = new XML_Unserializer();
  19. $result $unserializer->unserialize($xml);
  20.  
  21. if$result === true {
  22.     echo '<pre>';
  23.     print_r($unserializer->getUnserializedData());
  24.     echo '</pre>';
  25. }
  26. ?>

Documentation generated on Mon, 11 Mar 2019 14:13:45 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.