Home >Backend Development >PHP Tutorial >PHP uses the trim function to remove left and right spaces and special characters from a string. Examples of trim special characters_PHP tutorial

PHP uses the trim function to remove left and right spaces and special characters from a string. Examples of trim special characters_PHP tutorial

PHP中文网
PHP中文网Original
2016-07-12 09:01:18942browse


PHP uses the trim function to remove left and right spaces and special characters from a string. Examples of trim special characters


This article describes the use of PHP The trim function removes left and right spaces and special characters from a string. Share it with everyone for your reference, the details are as follows:

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

trim(string,charlist)

The parameter description is as follows:

string required. Specifies the string to check.

charlist

Optional. Specifies which characters are removed from the string. If omitted, all following characters are removed:
"

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn