- var_dump: documentation ( source)
- simplexml_load_string: documentation ( source)
<?php
$string = <<<XML
<a>
<foo name="one" game="lonely">1</foo>
</a>
XML;
$xml = simplexml_load_string($string);
var_dump($xml->foo[0]);exit;
$xml = simplexml_load_string($string);
foreach($xml->foo->attributes() as $a => $b) {
echo $a,'="',$b,"\"\n";
}
?>