php删除字符串中的空格的方法:首先创建一个PHP示例文件;然后通过“function trimall($str){$qian=array(" "," "," "," "," ");}”方法删除字符串中的空格即可。
推荐:《PHP视频教程》
php删除字符串中的所有空格
其实是对trim函数的扩展
trim只能删除字符串两边的空格
php代码
function trimall($str)//删除空格 { $qian=array(" "," "," "," "," "); $hou=array("","","","",""); return str_replace($qian,$hou,$str); }
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com