PHP4 User Manual: function-trim_PHP tutorial-php Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.