I want to display a ",(comma)" in between each records fetched from the db.eg:location1,location2,location3 etc
<table class="table table-striped table-condensed table-hover">
<?php
//var_dump($volunteer_panel_location);
echo "<tr>"
. "<td class='col-xs-4'>Interview Location </td>"
. "<td>";
foreach ($volunteer_interview_location as $vlocations)
{
echo "{$vlocations->location}";
}
echo "</td></tr>"
. "<tr>"
. "<td>Panel Location </td>"
. "<td>";
foreach ($volunteer_panel_location as $plocations)
{
echo "{$plocations->location}";
}
echo "</td>"
. "</tr>";
?>
</table>
I tried this,but the records repeated
$pp=array();
foreach ($volunteer_panel_location as $plocations)
{
$pp[]=$plocations->location;
echo implode(",",$pp);
}