SimpleXMLElement->attributes
Identifies an element's attributes
Description
SimpleXMLElementsimplexml_element->attributes
stringdata
This function provides the attributes and values defined within an xml tag.
&simplexml.iteration;
Interpret an XML string
1
XML;
$xml = simplexml_load_string($string);
foreach($xml->foo[0]->attributes() as $a => $b) {
echo $a,'="',$b,"\"\n";
}
?>
]]>
This script will display: