去除字符串全部空格function trimall($str) { $qian=array(" "," ","\t","\n","\r"); $hou=array("","","","",""); return str_replace($qian,$hou,$str); } AD:真正免费,域名+虚机+企业邮箱=0元