PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Mon Feb 21, 2005 5:42 pm
I have a string such as:
I need to remove the additional double spaces. However using:
Doesn't cut it because I'm still left with double spaces. I really don't want to toss the string in a loop. any suggestions?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Feb 21, 2005 5:57 pm
Code: Select all
$str = preg_replace('#ї ]+#', ' ', $str);
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Mon Feb 21, 2005 6:05 pm
Thanks Feyd, works great.