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

Source for file example6.php

Documentation is available at example6.php

  1. <?PHP
  2. /**
  3.  * XML_Beautifier example 6
  4.  *
  5.  * This example displays the multilineTags option.
  6.  * Furthermore it shows what happens, when no output file
  7.  * is specified.
  8.  *
  9.  * @author    Stephan Schmidt <schst@php.net>
  10.  */
  11.     error_reportingE_ALL );
  12.  
  13.     require_once 'XML/Beautifier.php';
  14.  
  15.     $fmt = new XML_Beautifierarray"multilineTags" => true ) );
  16.     $result $fmt->formatFile('test.xml');
  17.  
  18.     echo "<h3>Original file</h3>";
  19.     echo "<pre>";
  20.     echo htmlspecialchars(implode("",file('test.xml')));
  21.     echo "</pre>";
  22.         
  23.     echo    "<br><br>";
  24.     
  25.     echo "<h3>Beautified file</h3>";
  26.     echo "<pre>";
  27.     echo htmlspecialchars($result);
  28.     echo "</pre>";
  29. ?>

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