How Not to Display a seperator or a border after last data of the list?

beigniste

New Member
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 \[code\]<ul>\[/code\] and \[code\]<li>\[/code\]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 DBbelow is the format of data to be displayed and in it, the last \[code\]<li>\[/code\] is for displaying separator\[quote\] UPDATED\[/quote\]\[code\]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> }\[/code\]
 
Back
Top