Re: [virgodesign] Check for last-record in list-viewer
Hi Avrom,
Try this:
<?php foreach ($sub_galleriesMenus as $record): ?>
<a href="#"><?php echo $record['gallery_name'] ?></a> •
<?php $isLastRecord = $record['num'] == $sub_galleriesMenus[-1]['num'] ?>
<?php if (!$isLastRecord): ?> • <?php endif ?>
<?php endforeach ?>
When you have an array (list) of records you can refer to them by number like this: $array[1], etc. Except it starts at zero. You can also refer to the last item in the list with -1. So this checks if the current record number being displayed has the same number as the last records number.
Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com