- simplexml_load_string: documentation ( source)
- print_r: documentation ( source)
<?php
$string= <<<xml
<?xml version="1.0"?>
<document>
<people>
<name>Ali</name>
<family age="20">Bagheri</family>
</people>
<people>
<name>Reza</name>
<family age="20">Moghadam</family>
</people>
</document>
xml;
$x=simplexml_load_string($string);
print_r($x);
?>