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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -