why does this code not work correctly or what am I doing incorrectly?
$json = json_encode($myInstance->getData($id));
$result = json_decode($json,true);
$i = 0;
foreach ($result as $value) {
echo '<div>'.$value[$i]['name'].'</div>';
$i++;
}
The first value is shown correctly but it doesn't iterate through!
Is $value[$i]['name']
not build for iterating??
It Only prints the array[0]
not the array[1]
. Thanks.