PHPtrim () function usage, phptrim function usage _ PHP Tutorial

Source: Internet
Author: User
Some usage of the PHPtrim () function and the phptrim function. Some usage of the PHPtrim () function and the phptrim function use stringtrim (string $ str [, string $ charlist])-removes spaces (or other characters) at the beginning and end of the string trim () PHP trim () functions and phptrim functions

StringTrim(String$ Str[, String$ Charlist])-Removes spaces (or other characters) at the beginning and end of the string)

When the second parameter of the trim () function is null, spaces, tabs, line breaks, carriage returns, and Vertical tabs are removed by default. when the second parameter is added

1) trim ('\ "string \"', '\ "sg'); // final output: \" strin

2) trim ('\ "string \"', '\ "sg'); // final output: \" string \"

2) trim ('\ "string \"', '\ "sg'); // The final output is trin.

Therefore, the trim () function preferentially removes the spaces at the beginning and end of a character, and then filters out the given characters (lists) to be removed. This function is also applicable to the ltrim () and rtrim () functions.

Some usage of the http://www.bkjia.com/PHPjc/983852.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/983852.htmlTechArticlePHP trim () function, phptrim function usage string trim (string $ str [, string $ charlist])-removes spaces (or other characters) at the beginning and end of a string) trim () 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.