I have the following and I'm trying to get the numbers after 'items'
(2034, 6390, 9803
) and their values.
array (
'items' =>
array (
2034 =>
array (
0 =>
array (
'type' => 31,
'id' => -1901750,
'time' => '52:31',
),
),
6390 =>
array (
0 =>
array (
'desc' => 'Box',
'type' => 1,
'id' => 1901750,
'time' => '52:31',
),
),
9803 =>
array (
0 =>
array (
'type' => 30,
'id' => -1901809,
'time' => '84:27',
),
),
),
)
I've tried the following and returns an error Notice: Array to string conversion
$decode_two = json_decode($str2,TRUE);
foreach($decode_two['items'] as $value2) {
echo '<li>' . $value2 . ' </li>';
}
I know what the error means but I'm not sure what to put after $value2[?]
.
Thank you