我希望你能够去掉所有不在两个字母之间的空格:
$string = " bah bah bah bah ";
$string = str_replace("/w /w", "+", $string);
// what goes here? to get this:
$string = "bah+bah+bah+bah";
我的想法是要去除所有不必要的空格(不仅仅是开头和结尾)。这不是针对链接,而是针对搜索框,在提交时将被分解,因此+甚至可以是=或任何其他字符。
preg_replace()
函数中。 - casraf