So this may end up being a simple question but I have some code that looks at a JSON string and currently returns the image at array point 0 but I would like it to iterate for all the "hits" for this example there are 15 hits.
I imagine its a for each loop but i've searched and tried and cant figure it out. Any help would be greatly appreciated.
Here is my code
$content = curl_exec($ch);
$data = json_decode($content);
$jim = $data->hits[0]->thumbnailUrl;
echo "<img src='" . $jim . "' alt='error'>";
currently this code displays one image but I would like it to display for all the images its hits on. I can manually change which image it displays by changing the value hits[0] to be hits[2] for example.