Example of DOMDocument->normalize() : DOM : XML PHP Source Code


PHP Source Code » XML » DOM »

 

Example of DOMDocument->normalize()


<?php

$xmlstr 
= <<<XML

<employee>

<employeename>test</employeename>

<employeeaddress>test123</employeeaddress>

<SSN>12343456</SSN>

<company>TOPXML</company>

</employee>

XML;

  
$dom = new domDocument;

  
$dom->loadXML($xmlstr);

  
$dom->normalize();

?>        


HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo XML
» DOM