📌  相关文章
📜  从字符串 php 代码示例中删除最后一个逗号

📅  最后修改于: 2022-03-11 14:54:40.726000             🧑  作者: Mango

代码示例4
//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;
}