String Manipulation
Posted: 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?
Code: Select all
$str = 'The car is red';I need to remove the additional double spaces. However using:
Code: Select all
str_replace(' ', ' ',$str);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?