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)].
php functions to remove spaces are:
1. Remove spaces on both sides
trim($arr)
2. Regular matching removes all spaces
preg_replace('# #','',$goodid)
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!