I want to display a gallery and have an array which consists of image fields.
I am iterating through the array which works perfectly fine but I want to have access to the key of the items too.
<? foreach ($data->img_gallery as $key=>$image) { ?>
// some code
But the $key variable in my array returns the filenames (image1.jpg), not the index key (0, 1, 2, ....).
Why is that so? Does it have something to to with the fieldtype (in my case: Image)?
When I am using the same functionality for other fieldtypes (Page or Repater) the key delivers the index as supposed.