trim (PHP 4, PHP 5, PHP 7, PHP 8) trim — Strip whitespace (or other characters) from the beginning and end of a string This function returns a string with whitespace stripped from the beginning and end of string. Without the second parameter, trim() will strip these characters: " " (ASCII 32 (0x20)), an ordinary space. "\t" (ASCII 9 (0x09)), a tab. "\n" (ASCII 10 (0x0A)), a new line (line feed). "
![PHP: trim - Manual](https://cdn-ak-scissors.b.st-hatena.com/image/square/4dd02c2555ca1b32548779e23dc3e33a9f46bf13/height=288;version=1;width=512/https%3A%2F%2Fwww.php.net%2Fimages%2Fmeta-image.png)