How to remove last character from a string inside a loop

前端 未结 3 1902
再見小時候
再見小時候 2021-01-28 19:45

I am trying to print the different category\'s selected in a single line in xml, like

meeting, food and drinks, sports
         


        
3条回答
  •  不知归路
    2021-01-28 20:20

    You can do this by [i used my variable]

    $str = substr($str,0, (strlen($str)-1));
    

提交回复
热议问题