i agree, using a string function for replacing a single character (a space in this case) is much more efficient than using regular expressions. But, both work, so its up to you. The best way to find functions like that is become familiar with how the manual on php.net is organized, and then use the function catagories to find functions you need. If you find a function close to what you need, you will usually find a link in that function to the exact one you need.