//删除空格和回车 function trimall($str){ $qian=array(" "," ","\t","\n","\r"); return str_replace($qian, ‘‘, $str); }
//多个连续空格只保留一个 function merge_spaces($string){ return preg_replace("/\s(?=\s)/","\\1",$string); }
原文地址:https://www.cnblogs.com/zsczsc/p/11690331.html
时间: 2024-11-05 18:35:34