CoralCode Web programming snippets

30Nov/100

PHP – Remove multiple spaces

To remove multiple spaces in a string and replace it with a single space character simply use the following code:

$text = preg_replace('/\s+/', ' ', $text);
Filed under: PHP Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.