首頁 >後端開發 >php教程 >case western reserve universit php壓縮多個CSS為一個css的程式碼並且緩存

case western reserve universit php壓縮多個CSS為一個css的程式碼並且緩存

WBOY
WBOY原創
2016-07-29 08:44:521190瀏覽

複製程式碼 程式碼如下:


?php
/*
Compress multipleone files intophp
/*
Compress multipleone files intophp
/*
Compress multipleone files intophp 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 "nn";

include('anotherfile.css');

echo "nn";

ob_flush();

以上就介紹了case western reserve universit php壓縮多個CSS為一個css的程式碼並緩存,包括了case western reserve universit方面的內容,希望對PHP教程有興趣的朋友有所幫助。
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn