I am using PHP SOAP script to retrieve data from a web service. My PHP code shown below results in a stdclass obect which includes an array called Staff.
$values = $client->GetAllStaff($search_query);
$xml = $values->SasReqRespGetAllStaff;
print "<pre>
";
print_r($xml);
print "</pre>";
?>
This produces the following result on in my web browser.
"stdClass Object ( [Source] => R5 Sim [RespMsgTag] => 5 [RespAck] => OK [RespNote] => [TotalItems] => 13 [Staff] => Array ( [0] => stdClass Object ( [StaffID] => 15 [Last] => LastName1 [First] => TESTstaffOut1 [Middle] => MName1 [Role] => Level 1 ) [1] => stdClass Object ( [StaffID] => 16 [Last] => LastName2 [First] => TESTstaffOut2 [Middle] => MName2 [Role] => Level 2 )"
How can I write the values from [Staff] => Array into PHP variables that can be used later or for other PHP? How can I loop through Staff [0], [1]?