There is XML received from a third-party server:
object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(5) { ["message_id"]=> string(1) "0" ["message_phone"]=> string(11) "**********" ["message_parts"]=> string(1) "1" ["message_zone"]=> string(1) "1" ["message_cost"]=> string(3) "0,6" } } Either I'm stupid, or I just don't understand, I need to pull out the @attributes values
$xml=simplexml_load_string($str); But how do I get to $xml->@attributes ? Sign @ not put - you can not.