le 29/03/2009 à 23:39
Modification d'un elements dans un balise XML
grâce à une personne j'ai ma réponse je mets ce qui faut faire, si d'autre cherche aussi.
$xml_str = <<<END
<a>
<b>foo</b>
</a>
END;
$xml = simplexml_load_string ($xml_str);
$result = $xml->xpath ('/a/b');
$result[0][0] = 'bar';
print $xml->asXML ();
il fallait tout simplement mettre le second tableau a "0". trop bette le réponse ^^"
$xml_str = <<<END
<a>
<b>foo</b>
</a>
END;
$xml = simplexml_load_string ($xml_str);
$result = $xml->xpath ('/a/b');
$result[0][0] = 'bar';
print $xml->asXML ();
il fallait tout simplement mettre le second tableau a "0". trop bette le réponse ^^"
