PHP去除所有的空格

1、去除两边的空格

  trim($arr)

2、正则匹配去除所有的空格

  preg_replace('# #','',$goodid)

原文地址:https://www.cnblogs.com/sweet521/p/6138844.html