I have an XML file, how can I parse it using PHP? Note that the parameter has both a value and an attribute.
<?xml version="1.0" encoding="UTF-8"?> <xml> <price currency="EUR"></price> <phone currency="4.95" >val 1</phone> <phone currency="5.95" >val 2</phone> </xml>
simplexml_load_string($str)->price->attributes()->currency
- DaemonHK$obj->field
attributes through$obj['attr']
- teran