(PHP 5)

simplexml_load_string --  Interprets a string of XML into an object.


object simplexml_element simplexml_load_string ( string data)

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.

Example 1. Interpret an XML string

= <<<XML
<?xml version='1.0'?>
<title>Forty What?</title>
  I know that's the answer -- but what's the question?

$xml = simplexml_load_string($string);


This script will display:

simplexml_element Object
  [title] => 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().

Sites of interest: Web Hosting : Reseller Hosting : Website Hosting : HTML Editor : Web Design Templates : Free Web Hosting : ASP code examples : PHP & MySQL Code Examples
  Copyright 2004 Evrsoft Developer Network. Privacy policy - Link to Us

Contact Evrsoft