style.css.php
css 내용이 많거나 파일이 나누어져있을때 코드압축..
style.css.php
---------------
<?php
header('Content-type: text/css');
ob_start("compress");
function compress($buffer) {
/* remove comments */
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
/* remove tabs, spaces, newlines, etc. */
$buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer);
return $buffer;
}
/* your css files */
include_once "style.css";
ob_end_flush();
?>
이렇게 하고
<link rel="stylesheet" href="<?=$g4['path']?>/style.css.php" type="text/css" />
요로크롬 불러주시면 됩니다.~ JS도 비슷한방법으로 ~~
http://egghyun.playcast.kr/style.css.php?compression<-소스보기 ㄱㄱ
style.css.php
---------------
<?php
header('Content-type: text/css');
ob_start("compress");
function compress($buffer) {
/* remove comments */
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
/* remove tabs, spaces, newlines, etc. */
$buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer);
return $buffer;
}
/* your css files */
include_once "style.css";
ob_end_flush();
?>
이렇게 하고
<link rel="stylesheet" href="<?=$g4['path']?>/style.css.php" type="text/css" />
요로크롬 불러주시면 됩니다.~ JS도 비슷한방법으로 ~~
http://egghyun.playcast.kr/style.css.php?compression<-소스보기 ㄱㄱ
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 9개
추천요~
js 도 좀만 예제 갈켜 주실수 있을까요 6^?
많은도움 되었습니다.`