php怎么去掉字符串空行
- 建站笔记
- 2022-05-20
- 632
php去掉字符串空行的方法:1、创建一个PHP示例文件;2、通过“function DeleteHtml($str){...}”方法去掉html中的空行或空白即可。
本文操作环境:Windows7系统、PHP7.1版、DELL G3电脑
php怎么去掉字符串空行?
PHP去掉html中的空行、空白函数
function DeleteHtml($str){ $str = trim($str); $str = ereg_replace("\t","",$str); $str = ereg_replace("\r\n","",$str); $str = ereg_replace("\r","",$str); $str = ereg_replace("\n","",$str); return trim($str); }
本文由白琉璃于2022-05-20发表在白琉璃源码网,如有侵权或疑问,请联系我们,谢谢。
本文链接:https://www.bailiuli.com/t/2071.html
下一篇
php数据库怎么修改某值
发表评论