使用php怎么将html格式转换为文本格式-创新互联

使用php怎么将html格式转换为文本格式?针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。

十载的新田网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。营销型网站建设的优势是能够根据用户设备显示端的尺寸不同,自动调整新田建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。创新互联从事“新田网站设计”,“新田网站推广”以来,每个客户项目都认真落实执行。
function html2text($str){
 $str = preg_replace("//is", "", $str);
 $str = preg_replace("//is", "", $str);
 $str = preg_replace("//i", ">>>>", $str);
 $str = preg_replace("/<\\/?p>/i", ">>>>", $str);
 $str = preg_replace("/<\\/?td>/i", "", $str);
 $str = preg_replace("/<\\/?div>/i", ">>>>", $str);
 $str = preg_replace("/<\\/?blockquote>/i", "", $str);
 $str = preg_replace("/<\\/?li>/i", ">>>>", $str);
 $str = preg_replace("/ /i", " ", $str);
 $str = preg_replace("/ /i", " ", $str);
 $str = preg_replace("/&/i", "&", $str);
 $str = preg_replace("/&/i", "&", $str);
 $str = preg_replace("//i", ">", $str);
 $str = preg_replace("/>/i", ">", $str);
 $str = preg_replace("/”/i", '"', $str);
 $str = preg_replace("/&rdquo/i", '"', $str);
 $str = strip_tags($str);
 $str = html_entity_decode($str, ENT_QUOTES, "utf-8");
 $str = preg_replace("/&#.*?;/i", "", $str);
 return $str;
}

关于使用php怎么将html格式转换为文本格式问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注创新互联行业资讯频道了解更多相关知识。


分享题目:使用php怎么将html格式转换为文本格式-创新互联
本文路径:http://hxwzsj.com/article/dsgihg.html

其他资讯

Copyright © 2025 青羊区翔捷宏鑫字牌设计制作工作室(个体工商户) All Rights Reserved 蜀ICP备2025123194号-14
友情链接: 成都网站建设公司 营销型网站建设 移动手机网站制作 成都网站制作 网站建设公司 高端定制网站设计 网站制作报价 企业网站制作 重庆网站建设 网站制作 营销网站建设 网站建设开发 营销型网站建设 成都定制网站建设 成都网站建设流程 重庆网站建设 成都网站建设 重庆网站制作 成都网站制作 高端网站建设 网站设计 成都做网站建设公司