I am trying to fetch data from a table, and when I need to print the result then I am using comma separator to split the result. But I don't want to show the last comma.
Please see the code below:
<?php if($result_sender2):
foreach($result_sender2 as $row_sender2):
echo $row_sender2->fname.',';
endforeach;
endif;
?>
and the result is
Kunal,James,
here in the above example, I am using a comma separator. It works fine for me, but I don't want to show the last comma after "James".