Home  >  Article  >  Backend Development  >  Examples of removing left and right spaces and special characters with ltrim and rtrim in PHP

Examples of removing left and right spaces and special characters with ltrim and rtrim in PHP

PHP中文网
PHP中文网Original
2017-06-09 13:53:151431browse

This article mainly introduces the usage of ltrim and rtrim in PHP to remove left and right spaces and special characters. It explains in detail the definitions of ltrim and rtrim, the function of parameters and the usage skills of removing left and right spaces and special characters in the form of examples. What is needed Friends can refer to this article

This article analyzes the usage of ltrim and rtrim to remove left and right spaces and special characters in PHP. Share it with everyone for your reference, the details are as follows:

1. The definition of ltrim in PHP is as follows:

ltrim(string,charlist)

Parameter description:

string required. Specifies the string to check.

charlist
Optional. Specifies which characters are removed from the string. If this parameter is omitted, all the 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
Previous article:Introduction to NginxNext article:Introduction to Nginx