simplexml_load_string
Interprets a string of XML into an object
Description
objectsimplexml_load_string
stringdata
stringclass_name
This function will take the well-formed xml string
data and return an object with properties
containing the data held within the xml document. If any errors
occur, it returns &false;.
Interpret an XML string
Forty What?
Joe
Jane
I know that's the answer -- but what's the question?
XML;
$xml = simplexml_load_string($string);
var_dump($xml);
?>
]]>
This script will display:
Forty What?
[from] => Joe
[to] => Jane
[body] =>
I know that's the answer -- but what's the question?
)
]]>
At this point, you can go about using $xml->body
and such.
See also: simplexml_load_file.