[PHP] php压缩CSS文件"\r\n", & →→→→→进入此内容的聊天室

来自 , 2019-12-27, 写在 PHP, 查看 124 次.
URL http://www.code666.cn/view/040a99f2
  1. header('Content-type: text/css');
  2. ob_start("compress");
  3. function compress($buffer) {
  4.   /* remove comments */
  5.   $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
  6.   /* remove tabs, spaces, newlines, etc. */
  7.   $buffer = str_replace(array("\r\n", "\r", "\n", "\t", '  ', '    ', '    '), '', $buffer);
  8.   return $buffer;
  9. }
  10.  
  11. /* your css files */
  12. include('master.css');
  13. include('typography.css');
  14. include('grid.css');
  15. include('print.css');
  16. include('handheld.css');
  17.  
  18.  

回复 "php压缩CSS文件"\r\n", &"

这儿你可以回复上面这条便签

captcha