这是一个例子。是否可以保存输出缓冲区。我想缓存它要输出的内容。
header('Content-type: text/css');
ob_start("compress");
function compress($buffer) {
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
$buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer);
return $buffer;
}
include('layout.css');
include('pages.css');
include('form.css');
include('global.css');
ob_end_flush();