What are the functions for removing spaces in php?

coldplay.xixi
Release: 2023-03-06 12:14:01
Original
3207 people have browsed it

php functions to remove spaces include: 1. Function [trim($arr)] removes spaces on both sides; 2. Function [preg_replace()] regular matching to remove all spaces, the code is [preg_replace('# # ','',$goodid)].

What are the functions for removing spaces in php?

php functions to remove spaces are:

1. Remove spaces on both sides

  trim($arr)
Copy after login

2. Regular matching removes all spaces

  preg_replace('# #','',$goodid)
Copy after login

If you want to learn more about programming, please pay attention to the php training column!

The above is the detailed content of What are the functions for removing spaces in php?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!