I want to replace all instances of multiple sequential spaces in a string with a single space. the str_replace function won't let me replace any 2 characters (like "tt") with a single character (like "M") -- I get a "php3.cgi in realloc(): warning: chunk is already free." error. So I can't replace " " with " ", or even "tt" with "t". I can't use trim(), as the spaces are not trailing/leading spaces. What can I do?