Hi I'm trying to find the last array of $linkNumber from my for each loop as i have an image outside the foreach loop that needs the data-slide-index to be the last array plus 1. Any help how to achieve this?
<?php $linkNumber = 0;?>
<?php foreach ($variables as $variable){ ?>
<img src="$variable" data-slide-index="$linkNumber++"/>
<?php } ?>
<img src="#" data-slide-index="<?php $linkNumber + 1;?>"