- simplexml_load_string: documentation ( source)
<?php
$filename = '<joku><NO_MARK LG="FI">9.<fi>Termos</fi></NO_MARK>
<TI_MARK LG="ES">Budjetti<es>Hola</es></TI_MARK></joku>';
$xml_file = simplexml_load_string($filename);
parseXML($xml_file->children());
function parseXML($xml_children)
{
foreach ($xml_children as $child){
echo $child->getName().':'. $child."<br>";
if ($child->count() > 0)
{
parseXML($child->children());
}
}
}