This is my xml object. I am unable to parse this in object array in my script.
SimpleXMLElement Object( [pagination] => SimpleXMLElement Object ( [@attributes] => Array ( [pageNumber] => 1 [pageSize] => 100 [totalAvailable] => 1 ) ) [users] => SimpleXMLElement Object ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => xxxxxxxx [name] => xxxxx [siteRole] => xxxxx [lastLogin] => xxxxxx [externalAuthUserId] => ) ) ) ) Here is my PHP code:
foreach($xml2->users as $item) { $userName = $item->attributes()->name; } Am I doing something wrong?