I have a PHP Simple XML Object with multiple values in it.
I am trying to target a specific QID in the object and find out the corresponding Role is.
Example:
SimpleXMLElement Object
(
[data] => Array
(
[0] => SimpleXMLElement Object
(
[QID] => Q5678
[Role] => Super Admin
)
[1] => SimpleXMLElement Object
(
[QID] => Q1234
[Role] => Super Admin
)
)
)
I couldn't really find anything that allowed me to search an object in this fashion like I can in JavaScript.
Would there be a way to say (Psuedo Code) : getRole('Q1234'); // Output Super Admin
I am able to change the structure of this output if needed but more so looking for verification that I can find this "Needle in a haystack" so to speak.
foreach (data)?