PHP4 User Manual: function-trim. Trim (PHP3, PHP44.0.0) trim -- removes the blank description of the start and end of a string stringtrim (stringstr [, stringcharlist]). note: The second parameter is used in the trim function PHP4.1.0.
(PHP 3, PHP 4> = 4.0.0) trim -- removes the blank description of the start and end of a string.
String trim (string str [, string charlist])
Note: The second parameter is used in PHP 4.1.0.
This function returns the new string after the str string is removed from the first and last spaces. Without the second parameter trim (), the following characters are removed:
"" (ASCII 32 (0x20), space;
"" (ASCII 9 (0x09), tab;
"" (ASCII 10 (0x0A), line break;
"" (ASCII 13 (0x0D), carriage return;
"" (ASCII 0 (0x00), empty character;
"X0B" (ASCII 11 (0x0B), vertical tab.
You can use the charlist parameter to specify the characters you want to remove. Simply list all characters that you want to be stripped. With... you can specify a range of characters.
Example 1. trim ()
For more information, see fancyfunction.ltrim.html> ltrim () and rtrim ().
Http://www.bkjia.com/PHPjc/532349.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/532349.htmlTechArticletrim (PHP 3, PHP 4> = 4.0.0) trim -- removes a blank description of the start and end of a string trim (string str [, string charlist]) note: the second parameter is used in the PHP 4.1.0 function...