stdClass Object
(
[request] => stdClass Object
(
[other] => stdClass Object
(
[4] => stdClass Object
(
[answer] => one
)
[5] => stdClass Object
(
[answer] => two
)
[6] => stdClass Object
(
[answer] => three
)
)
)
)
?>
I'm able to print out all the answers by looping with a foreach.
foreach( $result->request->other as $test )
$tests[] = $test->answer;
foreach($tests as $test1){
echo "<p>$test1</p><br>";
}
I'm a little confused on how to also echo out the answer number which in this case is 4 5 6. How do i echo them out as part of the loop. ex:
4 one
5 two
6 three