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

Source for file serializeAndReturn.php

Documentation is available at serializeAndReturn.php

  1. <?PHP
  2. /**
  3.  * Example that uses the returnResult option to directly return the serialized
  4.  * XML document in the serialize() method.
  5.  *
  6.  * @author Stephan Schmidt <schst@php.net>
  7.  */
  8.  
  9. require_once 'XML/Serializer.php';
  10.  
  11. $options = array(
  12.                     XML_SERIALIZER_OPTION_INDENT        => '    ',
  13.                     XML_SERIALIZER_OPTION_RETURN_RESULT => true
  14.                 );
  15.  
  16. $serializer &new XML_Serializer($options);
  17.  
  18. $foo = PEAR::raiseError('Just a test'1234);
  19.  
  20. $result $serializer->serialize($foo);
  21.  
  22. echo '<pre>';
  23. echo htmlspecialchars($result);
  24. echo '</pre>';
  25. ?>

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