摘要: 原字符串1,2,3,4,5,6,去掉最后一个字符",",最终结果为1,2,3,4,5,6代码如下:$str = "1,2,3,4,5,6,";$newstr = substr($str,0,strlen($str)-1);echo $newstr;//echo 1,2,3,4,5,6系统自带的函数即可实现这样的效果,两种方法: 1) substr($str, 0, -1) 2)rtrim($str, ",") 阅读全文
posted @ 2012-05-25 22:44 歪神weil 阅读(491) 评论(2) 推荐(0) 编辑