欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

PHP去掉html中的空行、空白函数_PHP教程

程序员文章站 2022-04-09 11:52:10
...
[php]
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);
}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/477966.htmlTechArticle[php] 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); ret...