定义
trim - 去除字符串里的空白符及其他指定字符
Strip whitespace (or other characters) from the beginning and end of a string
描述
trim ( string $str [, string $character_mask = "
x0B" ] ) : string
参数 character_mask
可指定任意字符,使用..可指定一个范围
默认去除下面五个字符
- " " (ASCII 32 (0x20)), an ordinary space - 普通空白符.
- " " (ASCII 9 (0x09)), a tab - 制表符.
- " " (ASCII 10 (0x0A)), a new line (line feed) - 换行符.
- " " (ASCII 13 (0x0D)), a carriage return - 回车符.
- "