Loop over Foreach Values : <p>I have a Nested array, within my JSON <code>$repsonse</code> The <code>ImageURI</code> vary from <code>[0]-[16]</code> sometimes there is 5 sometimes there is 16.</p>

<p>I would like to loop over <code>$car['Images'][0]['ImageURI'];</code> for example:
This is car has 4 cars and for the rest responds with a <code>Notice: Undefined offset:</code> So that when there is not 16 cars it accepts that's how many there are.  </p>

<pre><code>https://vehiclestock-public.pinnacledms.net/ViewVehiclePhoto.aspx?BUID=a3db2a66-b4fb-4ac2-a78a-0f042aab50af&amp;VUID=39bcc4df-b550-e911-a2cf-00155d187d03&amp;Rank=1&amp;Width=960https://vehiclestock-public.pinnacledms.net/ViewVehiclePhoto.aspx?BUID=a3db2a66-b4fb-4ac2-a78a-0f042aab50af&amp;VUID=39bcc4df-b550-e911-a2cf-00155d187d03&amp;Rank=2&amp;Width=960https://vehiclestock-public.pinnacledms.net/ViewVehiclePhoto.aspx?BUID=a3db2a66-b4fb-4ac2-a78a-0f042aab50af&amp;VUID=39bcc4df-b550-e911-a2cf-00155d187d03&amp;Rank=3&amp;Width=960https://vehiclestock-public.pinnacledms.net/ViewVehiclePhoto.aspx?BUID=a3db2a66-b4fb-4ac2-a78a-0f042aab50af&amp;VUID=39bcc4df-b550-e911-a2cf-00155d187d03&amp;Rank=4&amp;Width=960https://vehiclestock-public.pinnacledms.net/ViewVehiclePhoto.aspx?BUID=a3db2a66-b4fb-4ac2-a78a-0f042aab50af&amp;VUID=39bcc4df-b550-e911-a2cf-00155d187d03&amp;Rank=5&amp;Width=960 

Notice: Undefined offset: 5 in /customers/8/9/9/testsite.agency/httpd.www/api/wp-content/themes/divi-child/functions.php on line 101 Notice: Undefined offset: 6 in /customers/8/9/9/testsite.agency/httpd.www/api/wp-content/themes/divi-child/functions.php on line 102 Notice: Undefined offset: 7 in /customers/8/9/9/testsite.agency/httpd.www/api/wp-content/themes/divi-child/functions.php on line 103 Notice: Undefined offset: 8 in /customers/8/9/9/testsite.agency/httpd.www/api/wp-content/themes/divi-child/functions.php on line 104 Notice: Undefined offset: 9 in /customers/8/9/9/testsite.agency/httpd.www/api/wp-content/themes/divi-child/functions.php on line 105 Notice: Undefined offset: 10 in /customers/8/9/9/testsite.agency/httpd.www/api/wp-content/themes/divi-child/functions.php on line 106 Notice: Undefined offset: 11 in /customers/8/9/9/testsite.agency/httpd.www/api/wp-content/themes/divi-child/functions.php on line 107 Notice: Undefined offset: 12 in /customers/8/9/9/testsite.agency/httpd.www/api/wp-content/themes/divi-child/functions.php on line 108 Notice: Undefined offset: 13 in /customers/8/9/9/testsite.agency/httpd.www/api/wp-content/themes/divi-child/functions.php on line 109 Notice: Undefined offset: 14 in /customers/8/9/9/testsite.agency/httpd.www/api/wp-content/themes/divi-child/functions.php on line 110 Notice: Undefined offset: 15 in /customers/8/9/9/testsite.agency/httpd.www/api/wp-content/themes/divi-child/functions.php on line 111 Notice: Undefined offset: 16 in /customers/8/9/9/testsite.agency/httpd.www/api/wp-content/themes/divi-child/functions.php on line 112 `
</code></pre>

<p>Heres my Code:</p>

<pre><code>if(array_key_exists(0,$car['Images'])) {
                        if( isset($car['Images']) ) {
                        //it exists
                        echo    $car['Images'][0]['ImageURI'];
                        echo    $car['Images'][1]['ImageURI'];
                        echo    $car['Images'][2]['ImageURI'];
                        echo    $car['Images'][3]['ImageURI'];
                        echo    $car['Images'][4]['ImageURI'];
                        echo    $car['Images'][5]['ImageURI'];
                        echo    $car['Images'][6]['ImageURI'];
                        echo    $car['Images'][7]['ImageURI'];
                        echo    $car['Images'][8]['ImageURI'];
                        echo    $car['Images'][9]['ImageURI'];
                        echo    $car['Images'][10]['ImageURI'];
                        echo    $car['Images'][11]['ImageURI'];
                        echo    $car['Images'][12]['ImageURI'];
                        echo    $car['Images'][13]['ImageURI'];
                        echo    $car['Images'][14]['ImageURI'];
                        echo    $car['Images'][15]['ImageURI'];
                        echo    $car['Images'][16]['ImageURI'];
                        echo "&lt;br&gt;";echo "&lt;br&gt;";echo "&lt;br&gt;";

                        }
                    }else{
                     continue;
                    }
</code></pre>
