PHP去除浮点数后面多余的0 By PHP之路 | 2014年10月10日 0 Comment 如: 5.1000 转化为5.1 6.00 转化为6 $str = 1.2200; echo rtrim(rtrim($str, ‘0’), ‘.’);