There is an object in the following format: (xml format) [altLineId] & amp; gt; SimpleXMLElementObject ([0] & amp; gt; 651382441). You can get it all, but this is hard for me. There is an array under the object with an element key value named altLineId. Now I want to retrieve this 651382... there is an object as follows: (xml format)
[AltLineId] => SimpleXMLElement Object
(
[0] = & gt; 651382441
)
You can get the above information, but it's hard for me.
The object has an array with an element key value named altLineId.
Now I want to retrieve the 651382441
The methods are as follows:
$ A = $ tmp1 ['altlineid'] = $ spreadV ['altlineid'] [0]; // blank $ a = $ tmp1 ['altlineid'] = $ spreadV ['altlineid']-> 0; // error $ a = $ tmp1 ['altlineid'] = $ spreadV ['altlineid']-> [0]; // error $ a = $ tmp1 ['altlineid'] = $ spreadV ['altlineid']-> '0' // error $ a = $ tmp1 ['altlineid'] = $ spreadV ['altlineid']-> ['0'] // Error
Big solutions!
Reply content:
There is an object as follows: (xml format)
[AltLineId] => SimpleXMLElement Object
(
[0] = & gt; 651382441
)
You can get the above information, but it's hard for me.
The object has an array with an element key value named altLineId.
Now I want to retrieve the 651382441
The methods are as follows:
$ A = $ tmp1 ['altlineid'] = $ spreadV ['altlineid'] [0]; // blank $ a = $ tmp1 ['altlineid'] = $ spreadV ['altlineid']-> 0; // error $ a = $ tmp1 ['altlineid'] = $ spreadV ['altlineid']-> [0]; // error $ a = $ tmp1 ['altlineid'] = $ spreadV ['altlineid']-> '0' // error $ a = $ tmp1 ['altlineid'] = $ spreadV ['altlineid']-> ['0'] // Error
Big solutions!
$a = $tmp1['altLineId'] = $spreadV['altLineId']->{0};
I remember using SimpleXML for parsing.$spreadV->altLineId
You can get the first value. If there are multiple values, useforeach($spreadV->altLineId as $lineId){}
Okay. In addition, I want to spit out your tag. It is clear that the XML parsing result gives a JSONObject tag.