/** * 多個連續空格只保留一個 * * @param string $string 待轉換的字符串 * @return unknown */ static public function merge_spaces ( $string ) { return preg_replace ( "/\s(?=\s)/","\\1", $string ); }