How to parse the variables from a xml in php -


suppose xml content url in php variable (e.g $new).

below example of xml content:

<getresult> [{"abc": "123","xyz":"234","mno":"we4r5t"}] </getresult> 

when parsing of xml content in php like:-

$xmlobj = simplexml_load_string($new); error_log($xmlobj->getresult); 

i [{"abc": "123","xyz":"234","mno":"we4r5t"}]

but want retrieve inner content tag, e.g retrieve value of abc or xyz or mno.

how can that?

[{"abc": "123","xyz":"234","mno":"we4r5t"}] 

that's not xml-string it's json object. should parse json_decode ! http://php.net/manual/de/function.json-decode.php


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -