手机
当前位置:查字典教程网 >编程开发 >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结合ACCESS的跨库查询功能

PHP实现分页的一个示例

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

一个很方便的 XML 类!!原创的噢

php中文件上传的安全问题

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

php遍历类中包含的所有元素的方法

多php服务器实现多session并发运行

php实现格式化多行文本为Js可用格式

php实现将上传word文件转为html的方法

精品推荐
分类导航