I want to strip all spaces that are not between two letters:
$string = " bah bah bah bah ";
$string = str_replace("/w /w", "+", $string);
// what goes here? to get this:
$string = "bah+bah+bah+bah";
The idea is that i want to get rid of all unnecessary spaces(not only at the beginning and end). This is not for a link but for a search box that on submit will be exploded so the + can even be a = or anything basically
1 Answer