php压缩多个CSS为一个css的代码并缓存
代码如下:
<?php /* Compress multiple CSS files into one and cache for an hour. Use the same code for Javascript, but replace below "text/css" with "text/javascript" and of course make sure you include .js files instead of .css ones. */ ob_start("ob_gzhandler"); header("Content-type: text/css; charset: UTF-8"); header("Expires: ".gmdate("D, d M Y H:i:s", time() + 60*60)." GMT"); include('somefile.css'); echo "\n\n"; include('anotherfile.css'); echo "\n\n"; ob_flush();
相关推荐
qiupu 2020-11-04
多读书读好书 2020-11-03
RedCode 2020-10-28
jiedinghui 2020-10-25
Ladyseven 2020-10-22
hellowzm 2020-10-12
zuncle 2020-09-28
Ladyseven 2020-09-11
jiedinghui 2020-09-07
xiaohuli 2020-09-02
葉無聞 2020-09-01
impress 2020-08-26
ThikHome 2020-08-24
nicepainkiller 2020-08-20
hellowzm 2020-08-18