php 去掉字符串中的连续空白 简单

$return = preg_replace('#\s+#', ' ',trim($return));

原文地址:https://www.cnblogs.com/xiangxiaodong/p/2826825.html