手机
当前位置:查字典教程网 >编程开发 >php教程 >php压缩多个CSS为一个css的代码并缓存
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 "nn";

include('anotherfile.css');

echo "nn";

ob_flush();

【php压缩多个CSS为一个css的代码并缓存】相关文章:

php中关于socket的系列函数总结

php快速查找数据库中恶意代码的方法

php截取指定2个字符之间字符串的方法

typecho插件编写教程(二):写一个新插件

做一个有下拉功能的留言版

php分别做为cgi和module来运行的配置

给多个地址发邮件的类

php开发中的页面跳转方法总结

php中文件上传的安全问题

php输出全球各个时区列表的方法

精品推荐
分类导航