3 Retrieving XML With Curl and SimpleXML - PHP Tutorials

Retrieving XML With Curl and SimpleXML

SimpleXML Wrapup

simplexml_load_string($string) -- loads XML from a string variable
simplexml_load_file($filename) -- loads XML from a file specified

Once the data is loaded node names are stored as pseudo class variables and can be accessed via $simpleXML->child.

$simpleXML->xpath("XPath Statement") -- parses Xpath statements by calling the pseudo class function xpath on the simpleXML element.
$simpleXML->children() -- returns the names of child nodes
$simpleXML->attributes() -- returns the attributes for a node applied to

Finally SimpleXML <<  1 2 3 4 5
New Content