在 css 链接标签中使用 php 的目的是什么? [英] What is the purpose of using php inside css link tag?

查看:25
本文介绍了在 css 链接标签中使用 php 的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近遇到了这个,不明白.我用谷歌搜索过,但不确定我应该用什么谷歌搜索来找到我的问题的答案.

I've come across this recently and don't understand. I've Googled, but not sure what I should be Googleing to find answers to my questions.

<link type="text/css" rel="stylesheet" href="css/global.css<?=$debug?'?'.rand():''?>" />

我注意到这样的事情破坏了整个网站的风格.

I noticed something like this broke an entire website's styles.

推荐答案

如果调试模式打开,这会向 CSS URL 附加一个随机数.
这样做是为了打破缓存.

This appends a random number to the CSS URL if debug mode is on.
It's done to break caching.

这篇关于在 css 链接标签中使用 php 的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆