simplexml_load_string
Convertit un chaîne XML en objet
Description
objectsimplexml_load_string
stringdata
stringclass_name
simplexml_load_string convertit la chaîne XML
data
en objet possédant des propriétés contenant les données de la chaîne.
En cas d'erreurs, cette fonction retourne &false;.
Convertir une chaîne XML
Forty What?
Joe
Jane
I know that's the answer -- but what's the question?
XML;
$xml = simplexml_load_string($string)
var_dump($xml);
?>
]]>
&example.outputs;
Forty What?
[from] => Joe
[to] => Jane
[body] =>
I know that's the answer -- but what's the question?
)
]]>
A partir de là, vous pouvez utiliser $xml->body
et tout autre élément.
Voir aussi
simplexml_load_file.