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

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -