How Not to Display a separator or a border after last data of the list?
I have a list of data which is coded in the form of <ul>
and <li>
and it is formatted in the way that after every record a border or separator needs to be displayed but after last record this border should not be displayed.
I am aware of the fact that it has to be coded with the help of for loop, but I cannot catch the logic for that.
I am working in PHP and the data is being fetched from Mysql DB
below is the format of data to be displayed and in it, the last <li>
is for displaying separator
UPDATED
for ($i=0, $n=sizeof($order->products); $i<$n; $i++)
{
<ul>
<li class="col1"><?php echo $order->products[$i]['qty']; ?></li>
<li class="col2"><?php echo $product_image; ?></li>
<li class="col3"><?php echo $product_name; ?></li>
<li class="col4"><?php echo $currencies->display_price($finalprice, $order->products[$i]['tax'], $order->products[$i]['qty']); ?></li>
<li class="dotted-border"></li>
</ul>
}