博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
html 删除注释_使用PHP删除HTML注释
阅读量:2512 次
发布时间:2019-05-11

本文共 736 字,大约阅读时间需要 2 分钟。

html 删除注释

When it comes to sending content to users, I'm of the belief that less is more.  There's no reason for HTML comments to be sent down to the user -- they simply bloat the payload.  I remove unwanted HTML comments within my WordPress theme, so I thought I'd share the regex that does it:

在向用户发送内容时,我相信少即是多。 没有必要将HTML注释发送给用户-它们只是使有效负载膨胀。 我在WordPress主题中删除了不需要HTML注释,因此我想与他人分享正则表达式:

// Remove unwanted HTML commentsfunction remove_html_comments($content = '') {	return preg_replace('/
/', '', $content);}

That handy function, paired with output buffering, allows me to remove HTML comments from anywhere within the page.  Less load, less cruft for mobile users!

该便捷功能与输出缓冲配合使用,使我可以从页面中的任何位置删除HTML注释。 减轻负载,减少移动用户的负担!

翻译自:

html 删除注释

转载地址:http://jzpwd.baihongyu.com/

你可能感兴趣的文章
[MTK FP]用Python把图片资源image.rar中为.pbm后缀的文件更改为.bmp后缀的方法
查看>>
实验二
查看>>
[LeetCode]203. Remove Linked List Elements 解题小结
查看>>
测试一下
查看>>
vue base64
查看>>
【Django实战开发】案例一:创建自己的blog站点-1.安装及搭建开发环境
查看>>
Pie(二分)
查看>>
Mysql 索引优化
查看>>
09湖州二模(自选模块不等式)
查看>>
Mybatis Batch 批量操作
查看>>
Ubuntu server搭建Java web服务器
查看>>
WSGI学习系列WSME
查看>>
java读取xml配置文件和properties配置文件
查看>>
HDU 4300 Contest 1
查看>>
POJ 3311
查看>>
Button MouseEvent颜色变化
查看>>
Volist标签
查看>>
浅谈模块化
查看>>
14个免费访客行为分析工具
查看>>
beego orm关联查询之多对多(m2m)
查看>>