PHP uses the trim function to remove leading and trailing spaces of strings and special character instances. the trim special character _ PHP Tutorial

Source: Internet
Author: User
PHP uses the trim function to remove leading and trailing spaces and special characters. PHP uses the trim function to remove leading and trailing spaces and special characters. This document describes how PHP uses the trim function to remove leading and trailing spaces and special characters. Use the trim function in PHP to remove leading and trailing spaces and special characters.


This example describes how PHP uses the trim function to remove leading spaces and special characters from strings. We will share this with you for your reference. The details are as follows:

The trim () function in PHP is defined as follows::

Trim (string, charlist)

Parameters are described as follows:

String is required. Specifies the string to be checked.

Charlist

Optional. Specifies which characters are deleted from the string. If omitted, all the following characters are removed:
"\ 0"-NULL
"\ T"-tab
"\ N"-line feed
"\ X0B"-vertical tab
"\ R"-Press enter
""-Space

The sample code is as follows:

 "; Echo trim ($ str," \ r (: :) ");?>


The running result is as follows:

(: @ _ @ Provides a large number of excellent scripts and materials for Download @ _ @:) @ _ @ provides a large number of excellent scripts and materials for Download @_@

I hope this article will help you with PHP programming.

The above example shows how PHP uses the trim function to remove leading and trailing spaces and special characters from strings. the content of the trim special character _ PHP Tutorial. For more information, see The PHP Chinese website (www.php1.cn )!


Examples in this article describes how PHP uses the trim function to remove leading and trailing spaces and special characters from strings. Points...

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.