如何从php代码的所有文本框中删除多余的空间

问题描述 投票:0回答:1

我想添加一个功能来删除我的php代码文本框中编写的文本中的所有多余空格。怎么做?

removing-whitespace
1个回答
0
投票

如果您不在乎单词分隔符,而是需要真正的串行字符串:

$string = 'forexample string with space   and more';
$no_space = str_replace(" ","",$string);
© www.soinside.com 2019 - 2024. All rights reserved.