I have an JSON example which looks like this:
<list>
<info test1="a" test2="b" test3="c">abc</info><info test1="a" test2="b" test3="c">abc</info>
</list>
How do i access “test3”?
['list'][0]['info'];
I have an JSON example which looks like this:
<list>
<info test1="a" test2="b" test3="c">abc</info><info test1="a" test2="b" test3="c">abc</info>
</list>
How do i access “test3”?
['list'][0]['info'];
$RP = '<list>
<info test1="a" test2="b" test3="c">abc</info>
<info test1="a" test2="b" test3="c">abc</info>
</list>';
$xml = simplexml_load_string($RP, ‘SimpleXMLElement’, LIBXML_NOCDATA);
foreach($xml->children() as $resp) {
print_r ($resp);
}
Output will be
SimpleXMLElement Object
(
[@attributes] => Array
(
[test1] => a
[test2] => b
[test3] => c
)
[0] => abc
)
SimpleXMLElement Object
(
[@attributes] => Array
(
[test1] => a
[test2] => b
[test3] => c
)
[0] => abc
)