带有params和php realpath的路径
在合并多个css时,需要将相对路径转换为绝对路径 其中一个步骤是获取realpath 有一个带有css的引导程序:带有params和php realpath的路径,php,twitter-bootstrap,merge,params,realpath,Php,Twitter Bootstrap,Merge,Params,Realpath,在合并多个css时,需要将相对路径转换为绝对路径 其中一个步骤是获取realpath 有一个带有css的引导程序: @font-face { font-family: 'Glyphicons Halflings'; src: url('../fonts/glyphicons-halflings-regular.eot'); src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-ope
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
url('../fonts/glyphicons-halflings-regular.woff') format('woff'),
url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),
url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
realpath后的结果:
@font-face {
font-family: "Glyphicons Halflings";
src: url("/somepath/fonts/glyphicons-halflings-regular.eot");
src: url("") format("embedded-opentype"),
url("/somepath/fonts/glyphicons-halflings-regular.woff") format("woff"),
url("/somepath/fonts/glyphicons-halflings-regular.ttf") format("truetype"),
url("") format("svg");
}
对于具有参数的路径,返回false
如何为带有参数的路径获取realpath并保存参数?您指的是php函数“realpath”吗? 如果是这样的话,它不是要在url上使用,而是要在文件系统路径上使用 如果要为字体使用绝对路径,则应以“/”开头。 ie:url(“/css/font/glyphicons whateyoulike.ttf”)
开头的“/”将是web目录的根目录。css合并的步骤~:if\u preg\u math\u all\u(url)->exclude\u substr\u(协议和数据:)->realpath->获取网页