2009/10/25 Jeffry Lunggot <jef...@rogon.com.my>:
> Hi,
>
> how to replace many spaces in any string of character with  one space?

$str = preg_replace('/\s\s+/', ' ', $str);

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to