This is the example of an Array & Object:
$LObj = [
0 => (object) [
0 => 1,
1 => 'a',
3 => 'str',
],
1 => (object) [
0 => 2,
1 => 'a',
3 => 'str',
],
2 => (object) [
0 => 3,
1 => 'a',
3 => 'str',
],
1 => (object) [
0 => 4, //printme
1 => 'a',
3 => 'str',
],
'bonus' => (object) [
0 => '4',
'1' => 1,
'bonus' => 'str',
],
];
var_dump($LObj['bonus']);
echo $LObj['bonus']->0; // #1 how do you display '4' value?
echo $LObj['bonus']->1; // #2 how do you display 1 value?
echo $LObj['bonus']->bonus; // #3 is 'str'
I wanted to display each #1, #2, #3 as shown above using a single line of code (like #3) w/o using any loop (foreach). #3 is displayed correctly, problem is #1 & #2. I've been seeking answers but couldn't find one. Any help would be highly appreciated, thanks.