Possible Duplicate:
How do I strip all spaces out of a string in PHP?
Simply as it should be:
$text = 'This is the text with 3445';
I want it to be:
$trimmed = 'Thisisthetextwith3445';
Possible Duplicate:
How do I strip all spaces out of a string in PHP?
Simply as it should be:
$text = 'This is the text with 3445';
I want it to be:
$trimmed = 'Thisisthetextwith3445';
You could do:
str_replace(' ', '', $text);
as stated in How do I strip all spaces out of a string in PHP? which you could have found easily.
To remove one or more occurrences of white spaces:
$foo = preg_replace('/\s+/', ' ', $foo);