我想添加一个功能来删除我的php代码文本框中编写的文本中的所有多余空格。怎么做?
如果您不在乎单词分隔符,而是需要真正的串行字符串:
$string = 'forexample string with space and more'; $no_space = str_replace(" ","",$string);