(PHP 8 >= 8.4.0)
mb_trim — Strip whitespace (or other characters) from the beginning and end of a string
Performs a multi-byte safe trim() operation,
and returns a string with whitespace stripped from the
beginning and end of string.
Without the second parameter,
trim() will strip these characters:
" ": ASCII SP 字符
0x20,一个普通的空格。
"\t": ASCII HT 字符
0x09,一个制表符。
"\n": ASCII LF 字符
0x0A,一个换行符。
"\r": ASCII CR 字符
0x0D,一个回车符。
"\0": ASCII NUL 字符
0x00,一个 NUL 字节。
"\v": ASCII VT 字符
0x0B,一个垂直制表符。
stringcharacterscharacters 参数指定要剥离的字符。
只需列出所有需要剥离的字符。
使用 .. 可以指定一个递增的字符范围。
encodingThe trimmed string.