php - How can I separete these xml elements? -
i got xml response of
simplexmlelement object ( [@attributes] => array ( [version] => 2.0 [msg_type] => response ) [header] => simplexmlelement object ( [param] => array ( [0] => simplexmlelement object ( [@attributes] => array ( [name] => sn [value] => 1012 ) ) ... [9] => simplexmlelement object ( [@attributes] => array ( [name] => errorinfo [value] => na ) ) [10] => simplexmlelement object ( [@attributes] => array ( [name] => processtime [value] => 0 ) ) ) ) [heartbeat] => simplexmlelement object ( ) ) i tried:
$version1 = (string) $xml->version; // expecting "2.0" $errorinfo = (string) $xml->name->errorinfo; // expecting "na"
Comments
Post a Comment