I'm trying to replace all of the consecutive spaces with just one underscore; I can easily replace one space with "_" by using the following line of code:
str_replace(" ", "_",$name);
Evan I can replace one spaces with "_" by following line of code:
str_replace(" ", "_",$name);
But the problem is I don't know how many blank spaces I have to check!
If my question is not clear please let me know which part you need more clarification.
Thanks