php压缩多个CSS为一个css的代码并缓存

yipeiwu_com6年前PHP代码库
复制代码 代码如下:

<?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();

相关文章

php数组随机排序实现方法

本文实例讲述了php数组随机排序实现方法。分享给大家供大家参考。具体实现方法如下: <?php $array = array('A','2','3','4','5',...

PHP无刷新上传文件实现代码

index.html 复制代码 代码如下: <html> <head> <title>无刷新上传文件</title> <meta C...

php实现用户在线时间统计详解

首先介绍一下所涉及的数据表结构,四个字段: 代码如下: 复制代码 代码如下: uid<int(10)> :用户id session_id<varchar(40)>...

PHP获取POST数据的几种方法汇总

一、PHP获取POST数据的几种方法 方法1、最常见的方法是:$_POST['fieldname']; 说明:只能接收Content-Type: application/x-www-f...

php自动加载方式集合

php加载文件方式: 1、include,include_once,requice,requice_one常规加载 2、__autoload() 3、spl_autoload_regis...