i have the following code in html
<? foreach($tst as $test) : ?>
<?=$test->id?>,
<? endforeach ?>
and that will result as test1,test2,test3,
how avoid that last comma in simple method . I cant use complicated code in html like
<? $i = 0 ;?>
<? foreach($tst as $test) : ?>
<?=$test->id?>,
<? endforeach ?>
<? $i++ ;?>
<? if($i != count($tst)) :?>
,
<?endif;?>
<? endforeach;?>
Please Help :)