string trim ( string $str
[, string $charlist
] ) - Remove whitespace characters (or other characters) at the beginning and end of the string
The trim() function removes spaces, tabs, line feeds, carriage returns, and vertical characters by default when the second parameter is empty. Tab characters, etc., when adding the second parameter
1) trim(' "string"', '"sg'); // Final output: "strin
2) trim(' "string" ', '"sg'); // Final output: "string"
2)trim('"string"', '"sg'); // Final output: trin
So the trim() function first removes the blank characters at the beginning and end of the characters, and then filters out the given characters (list) to be removed. , also applies to ltrim(), rtrim() functions