首页 > 技术文章 > php 去除中间空格
weihua2018 2019-08-15 16:54 原文
<?php
$str = 'a b c d e ';
$str = preg_replace('# #','',$str);
var_dump($str);//输出 "abcde"