PHP多个连续空格回车替换为一个,如何写更简短?
php多个连续空格( )或者分段076402276aae5dbec7f672f8f4e5cc81替换为一个。如何改写下面这个更加简短?
<br /><br />function re($content)<br />{<br /> /* return preg_replace('/(<br\s*\/?>){3,}|( ){3,}/i'),'\\1',$content); */ //错误!<br /> /* return preg_replace('/(<br\s*\/?>| ){3,}/i'),'\\1',$content); */ //错误!<br /> return preg_replace(array('/(<br\s*\/?>){3,}/i','/( ){3,}/i'),'\\1',$content);<br />}<br /><br /><br />//test<br />$content = '1111 <br><br><br><br />@@@<br/><br><br/><br>aaaaM<br><br/>';<br />echo re($content);<br />exit();<br />