php去除字符串左右字符

php 去除字符串首尾字符

代码示例:
$str = '123,333,234,'; echo rtrim($str, ','); echo ltrim($str, ',');