Learn to delete string whitespace characters in php.
You can use the trim( ), ltrim( ), and rtrim( ) functions to remove the blanks at the masthead or end of a string:
$trimmed = trim(string[,charlist]);
$trimmed = ltrim(string[,charlist]);
$trimmed = rtrim(string[,charlist]);
trim() returns a copy of the string with leading and trailing spaces removed
ltrim() (l means left) does the same job, but only removes the string Whitespace on the left
rtrim() (r means right) only removes whitespace on the right of the string.
The above is the content of PHP learning to delete string whitespace characters. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!