Checking lest entry in a foreach

2 posts by 2 authors in: Forums > CMS Builder
Last Post: June 1, 2009   (RSS)

By willbegood - June 1, 2009

Hello,

lest's say i have a news section.
i've made a viewer code wich list all the entry of "news"
What i want is to check the very last entry and ad some html code in that entry

here is my code for exemple

<?php foreach ($newsRecords as $record): ?>
Record Number: <?php echo $record['num'] ?><br/>
title: <?php echo $record['title'] ?><br/>
description: <?php echo $record['description'] ?><br/>
<hr/>
<?php endforeach; ?>


So it will print this

Record Number : 1
title: abc
description : zzzzz
____________________

Record Number : 2
title: fgfgdf
description : zdfgdfghzzzz
____________________

Record Number : 3
title: abc
description : zzzzz
Here i want to dynamicaly add some content for the latest entry displayed
____________________

Can you help?