phpは文字列の連続する複数のスペースを一つのスペースに変換します。
272 ワード
転載元:http://www.phpernote.com/php-function/633.html
/**
*
*
* @param string $string
* @return string $string
*/
function merge_spaces($string){
return preg_replace("/\s(?=\s)/","\\1",$string);
}