Say I have user input of "this test" and it has three spaces in the middle, cause well, the user was stupid (or two spaces, or more, or some on the end).
Well, its easy to clean off the ends with a "trim()" function, but what about the middle?
I need some help with a regex that takes X amount of spaces consecutivly, and turns them all into 1 space.
Anyone be a peach and type that out? I really am terrible with understanding the foreign language that is regex in things like eregi, ereg, preg et al.
Thanks for the help!