php截取字符去掉最后一个字符

$str="中国、美国、俄罗斯、德国、"
$str=substr($str,0,-1);

输出结果为:中国、美国、俄罗斯、德国

原文地址:https://www.cnblogs.com/hailexuexi/p/4990796.html