trim - 去除字符串里的空白符及其余指定字符函数
Strip whitespace (or other characters) from the beginning and end of a stringspa
trim ( string $str [, string $character_mask = " \t\n\r\0\x0B" ] ) : string
参数 character_mask
可指定任意字符,使用..可指定一个范围
默认去除下面五个字符code
trim($text, " \t."); trim($hello, "Hdle"); // (from 0 to 31 inclusive) trim($binary, "\x00..\x1F");
相似函数,ltrim()
,rtrim()
ip