<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_59146"> <div class="blockcode"> <div id="code_c9a"><ol> <li>/**</li> <li>* 多个连续空格只保留一个</li> <li>*</li> <li>* @param string $string 待转换的字符串</li> <li>* @return unknown</li> <li>*/</li> <li>static public function merge_spaces ( $string )</li> <li>{</li> <li> return preg_replace ( "/s(?=s)/","", $string );</li> <li>}</li> </ol></div> <em onclick="copycode($('code_c9a'));">复制代码</em> </div> <br> </td></tr></table> <div class="ptg mbm mtn"> 多, PHP</div> <div id="comment_59146" class="cm"> </div> <div id="post_rate_div_59146"></div> <br><br>