📅  最后修改于: 2022-03-11 14:54:15.630000             🧑  作者: 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;
}