如何在PHP中删除字符串中的所有空格? [重复]

北慕城南 提交于 2020-10-06 07:02:25

问题:

Possible Duplicate: 可能重复:
To strip whitespaces inside a variable in PHP 在PHP中去除变量内的空格

How can I strip / remove all spaces of a string in PHP? 我怎么能剥夺 / 删除 PHP 字符串的所有空间

I have a string like $string = "this is my string"; 我有一个字符串,$string = "this is my string";

The output should be "thisismystring" 输出应该是"thisismystring"

How can I do that? 我怎样才能做到这一点?


解决方案:

参考一: https://stackoom.com/question/8qjN/如何在PHP中删除字符串中的所有空格-重复
参考二: https://oldbug.net/q/8qjN/How-do-I-strip-all-spaces-out-of-a-string-in-PHP-duplicate
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!