输入banner图图片脚本导航/分类

PHP去除多余空格多个连续空格只保留一个

  1. /**
  2. * 多个连续空格只保留一个
  3. *
  4. * @param string $string 待转换的字符串
  5. * @return unknown
  6. */
  7. static public function merge_spaces ( $string )
  8. {
  9. return preg_replace ( "/\s(?=\s)/","\\1", $string );
  10. }

多个, PHP