📅  最后修改于: 2022-03-11 14:54:40.726000             🧑  作者: Mango
//dont print last comma after string print using foreach loop
hasComma = false;
foreach ($this->sinonimo as $s){
if (hasComma){
echo ",";
}
echo ''.ucfirst($s->sinonimo).'';
hasComma=true;
}