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