首页
Python
Java
PHP
IOS
NodeJS
JavaScript
HTML5
小程序
AI
bah
全部标签
php - 去除 php 字符串中所有不必要的空格
我想去掉所有不在两个字母之间的空格:$string="bahbahbahbah";$string=str_replace("/w/w","+",$string);//whatgoeshere?togetthis:$string="bah+bah+bah+bah";我的想法是我想去掉所有不必要的空格(不仅是开头和结尾)。这不是用于链接,而是用于提交时会展开的搜索框,因此+甚至可以是=或任何基本内容 最佳答案 $string=preg_replace('/\s+/','',$string);
去除
php
section
string
bah
str-replace
Home
Powered By IT.CAOLU.XIN
页面耗时:0.0514s