Return PHP object by index number (not name)

iToastie

New Member
Goal: retrieve an element of data from within a PHP object by number.This is the print_r($data) of the object:\[code\]stdClass Object( [0] => stdClass Object ( [TheKey] => 1456 [ThingName] => Malibu [ThingID] => 7037 [MemberOf] => California [ListID] => 7035 [UserID] => 157 [UserName] => John Doe ))\[/code\]I can't figure out how to pull a value out of it. This is only one record of a multi-record object that should be by id rather than a name.These are some failed attempts to illustrate what the goal is:\[code\]echo $data -> 0 -> UserName;echo $data[0] -> UserName;\[/code\]
 
Back
Top