php删除字符串中空格的方法:1、使用str_ireplace()函数,语法“str_ireplace(' ', '', $str)”;2、使用str_replace()函数,语法“str_replace(' ', '', $str)”。

本教程操作环境:windows7系统、PHP7.1版,DELL G3电脑
方法1:使用str_ireplace()函数
输出:
helloworld!
方法2:使用str_replace()函数
立即学习“PHP免费学习笔记(深入)”;
输出:
helloworld!
推荐学习:《PHP视频教程》











