天天插天天日天天操天天干-精品宅男噜噜噜久久久-国产一区 亚洲一区-日韩一级特黄av在线-5566中文字幕丝袜人妻-久久久久久久国产精品电影-一本色道久久88—综合亚洲-中文字幕亚洲一区久久-国产三级一区二区在线观看,99国产久久精品,久久中文字幕不卡视频,精品人妻一区二区91

php壓縮css和js

時(shí)間:2014-06-23 來源:天津文率科技有限公司

首先你要知道php 《JSMin》 這個(gè)類,壓縮js很方便

css直接去回車就行了

file_put_contents(存放路徑,str_replace(array("\r\n", "\r", "\n"), "", file_get_contents(要壓縮的css文件路徑)));

$Jsmin      =   new \Common\Extend\Jsmin();

file_put_contents(存放路徑, $Jsmin->minify(file_get_contents(要壓縮的js路徑)) );

如有不明白的可以看我的博客,里面有一些php、js、css基礎(chǔ)的教程

韓文博的新浪博客:http://blog.sina.com.cn/u/1783136603

更多網(wǎng)站建設(shè)方面的教程可以看經(jīng)常來看我們的官網(wǎng),頻繁更新中,天津網(wǎng)站建設(shè) m.chinaaobo.com
下面是JSMin類

<?php

/**
 * jsmin.php - PHP implementation of Douglas Crockford's JSMin.
 *
 * This is pretty much a direct port of jsmin.c to PHP with just a few
 * PHP-specific performance tweaks. Also, whereas jsmin.c reads from stdin and
 * outputs to stdout, this library accepts a string as input and returns another
 * string as output.
 *
 * PHP 5 or higher is required.
 *
 * Permission is hereby granted to use this version of the library under the
 * same terms as jsmin.c, which has the following license:
 *
 * --
 * Copyright (c) 2002 Douglas Crockford  (www.crockford.com)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is furnished to do
 * so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * The Software shall be used for Good, not Evil.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 * --
 *
 * @package JSMin
 * @author Ryan Grove <ryan@wonko.com>
 * @copyright 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c)
 * @copyright 2008 Ryan Grove <ryan@wonko.com> (PHP port)
 * @license http://opensource.org/licenses/mit-license.php MIT License
 * @version 1.1.1 (2008-03-02)
 * @link http://code.google.com/p/jsmin-php/
 */
namespace Common\Extend;
class JSMin {
  const ORD_LF    = 10;
  const ORD_SPACE = 32;

  protected $a           = '';
  protected $b           = '';
  protected $input       = '';
  protected $inputIndex  = 0;
  protected $inputLength = 0;
  protected $lookAhead   = null;
  protected $output      = '';

  // -- Public Static Methods --------------------------------------------------

  public static function minify($js) {
    $jsmin = new JSMin($js);
    return $jsmin->min();
  }

  // -- Public Instance Methods ------------------------------------------------

  public function __construct($input) {
    $this->input       = str_replace("\r\n", "\n", $input);
    $this->inputLength = strlen($this->input);
  }

  // -- Protected Instance Methods ---------------------------------------------

  protected function action($d) {
    switch($d) {
      case 1:
        $this->output .= $this->a;

      case 2:
        $this->a = $this->b;

        if ($this->a === "'" || $this->a === '"') {
          for (;;) {
            $this->output .= $this->a;
            $this->a       = $this->get();

            if ($this->a === $this->b) {
              break;
            }

            if (ord($this->a) <= self::ORD_LF) {
              throw new JSMinException('Unterminated string literal.');
            }

            if ($this->a === '\\') {
              $this->output .= $this->a;
              $this->a       = $this->get();
            }
          }
        }

      case 3:
        $this->b = $this->next();

        if ($this->b === '/' && (
            $this->a === '(' || $this->a === ',' || $this->a === '=' ||
            $this->a === ':' || $this->a === '[' || $this->a === '!' ||
            $this->a === '&' || $this->a === '|' || $this->a === '?')) {

          $this->output .= $this->a . $this->b;

          for (;;) {
            $this->a = $this->get();

            if ($this->a === '/') {
              break;
            } elseif ($this->a === '\\') {
              $this->output .= $this->a;
              $this->a       = $this->get();
            } elseif (ord($this->a) <= self::ORD_LF) {
              throw new JSMinException('Unterminated regular expression '.
                  'literal.');
            }

            $this->output .= $this->a;
          }

          $this->b = $this->next();
        }
    }
  }

  protected function get() {
    $c = $this->lookAhead;
    $this->lookAhead = null;

    if ($c === null) {
      if ($this->inputIndex < $this->inputLength) {
        $c = $this->input[$this->inputIndex];
        $this->inputIndex += 1;
      } else {
        $c = null;
      }
    }

    if ($c === "\r") {
      return "\n";
    }

    if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) {
      return $c;
    }

    return ' ';
  }

  protected function isAlphaNum($c) {
    return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1;
  }

  protected function min() {
    $this->a = "\n";
    $this->action(3);

    while ($this->a !== null) {
      switch ($this->a) {
        case ' ':
          if ($this->isAlphaNum($this->b)) {
            $this->action(1);
          } else {
            $this->action(2);
          }
          break;

        case "\n":
          switch ($this->b) {
            case '{':
            case '[':
            case '(':
            case '+':
            case '-':
              $this->action(1);
              break;

            case ' ':
              $this->action(3);
              break;

            default:
              if ($this->isAlphaNum($this->b)) {
                $this->action(1);
              }
              else {
                $this->action(2);
              }
          }
          break;

        default:
          switch ($this->b) {
            case ' ':
              if ($this->isAlphaNum($this->a)) {
                $this->action(1);
                break;
              }

              $this->action(3);
              break;

            case "\n":
              switch ($this->a) {
                case '}':
                case ']':
                case ')':
                case '+':
                case '-':
                case '"':
                case "'":
                  $this->action(1);
                  break;

                default:
                  if ($this->isAlphaNum($this->a)) {
                    $this->action(1);
                  }
                  else {
                    $this->action(3);
                  }
              }
              break;

            default:
              $this->action(1);
              break;
          }
      }
    }

    return $this->output;
  }

  protected function next() {
    $c = $this->get();

    if ($c === '/') {
      switch($this->peek()) {
        case '/':
          for (;;) {
            $c = $this->get();

            if (ord($c) <= self::ORD_LF) {
              return $c;
            }
          }

        case '*':
          $this->get();

          for (;;) {
            switch($this->get()) {
              case '*':
                if ($this->peek() === '/') {
                  $this->get();
                  return ' ';
                }
                break;

              case null:
                throw new JSMinException('Unterminated comment.');
            }
          }

        default:
          return $c;
      }
    }

    return $c;
  }

  protected function peek() {
    $this->lookAhead = $this->get();
    return $this->lookAhead;
  }
}

// -- Exceptions ---------------------------------------------------------------
class JSMinException {}
//class JSMinException extends Exception {}
?>

聯(lián)絡(luò)方式:

中國 · 天津市河西區(qū)南京路35號亞太大廈1403室
電話:15620613686
郵編:300220

人人妻人人爽人人躁-精品少妇在线一区二区-精品久久久久久久一区二区8-精品国产乱码久久久久久 | 天天艹天天射天天操天天射-天天射天天操天天日-高清日本中文字幕在线-欧美日韩国产精品自拍 | 中文字幕av第二页-国产中文字幕日韩在线-久久久久 国产一区-久久av大吊操 | 激情亚洲av综合av成人-麻豆网站免费在线观看-欧美一级大片一区二区三区-久久视频这里只精品99热在线 | 精品国产乱码久久久久久毛-99精国产99久久久久-日本熟女熟妇bbw-欧美日韩亚洲欧美日韩亚洲欧美 | 国产最新在线视频麻豆-高清中文字幕一区二区三区-日韩一区二区三区四区中文字幕-亚洲熟妇久久国内精品 | 精品视频人妻少妇一区二区三区-国产成人综合久久久久久-97 久久超级精品97-99精品国产99久久 | 成人国产av精品密桃视频-日韩a级片网址-亚洲+欧美+国产+综合+-91久久国产熟女视频 | 东京热中文字幕在线播放-国产成人自拍视频在线免费播放-久久99亚洲精品久久网站-久久青青视频黄色一级 | 久久色资源站365-日韩欧美激情免费在线-久久久精品少妇999-麻豆成人版免费在线观看 | 最近中文字幕在线中文视频-91久久精品国产91久久久久-日韩黄片中文字幕-蜜臀99久久精品久久久久动漫 | 91康先生在线播放-日本免费一区二区三区四区-久久久999精品国-日韩毛片免费视频观看 | 欧美特黄特色aaa大片免费看-成人久久18免费-99久久精品费精品蜜-久久天天操狠狠操夜夜操2021 | 日韩精品——色哟哟-护士猛少妇色xxxxx猛叫-久久综合九色综合久久-91成人在线观看喷潮, | 免费观看中文字幕在线视频-欧美日韩精品色哟哟-久久高清一区二区三区蜜桃-久久视频在线精品观看 久久久久91国产精品-久久高清成人一区二区-成人三级视频在线观看一区二区-久草久草福利资源站 | 天天干天天躁久久综合-1024人妻一区二区三区-蜜桃久久久亚洲精品成-国产欧美日韩各 | 中文字幕人妻诱惑在线播放-久久嫩草精品久久久精品内容-中文字幕国产有码av-久久久精品国产亚洲乱码 | 9999精品在线播放-99人人妻人人澡人人狠-福利永久视频一区二区三区-亚洲国产aⅴ美女网站 | 国产精品人妻免费看-欧美高清视频一区二区三区-久热99这里只有精品-天天想发脾气想骂人怎么回事 中文字幕人妻九-91久久久久久综合-18禁国产精品久久久久欠-久久国产欧美日韩精品图片 | 91麻豆成人久久精品二区三区-2021精品久久久久精品k8-久久热在线只有精品-午夜精品久久久久久91蜜桃 | 精品久久久久久国产免费-少妇人妻视频在线看-人妻免费人人干视频-99精品六月婷婷综合在线 | 日本熟女俱乐部影片-91精品综合久久久久精品一本-99国产一区二区三区在线-欧美日韩激情视频在线观看 | 天天日天天干天天爽天天操-91精品国产色综合久久成人-一本色道久久88加勒比在线-日韩情色伦理视频网 | 国产精品18久久久久久不卡偷-精品人妻少妇一区二区三区免费观-加勒比精品视频在线观看-久久久久久夜夜夜猛噜噜 | 视色av毛片一区二区三区-人妻中文字幕av一区二区三区-激情五月开心五月在线视频-欧美激情一区二区三区p站 | 国产精品99久久av色婷综合-久久久国产成人av电影-久久精品综合在线观看-欧美日韩一区二区三区在线播放 | 日韩av中文一区二区三区-美女一区在线视频-黑人性视频多人欧美-精品人妻一区二区三区含 | 日韩区一视频高清在线观看-亚洲成人福利电影在线-精品丰满熟妇一区二区三区-av毛片av毛片av毛片 精品国产91自在自线-久久99热伊人99-久久艹视频经典-日韩中文字幕区有砖一区 | 日韩啪啪在线播放-亚洲欧美日韩有码-97久久成人在线观看-av一区二区欢迎您 | 人人妻人人澡人人爽久久av/-欧美黑人精品视频在线-麻豆精品传媒国产av在-国产中文字幕美女 | 成人熟女俱乐部-色婷婷精品一区=区-亚洲天堂中文字幕一区二区三区免费-日韩三级电影一区 | 韩日国一二三区中文字幕-91麻豆精品美女诱惑-久久久精品免费网站-蜜臀久久国产精品av | 国产熟女乱免费一区二区-亚洲精品字幕在线观看-91一区二区三区四五-欧美 日韩 综合 好大 | 欧美精品手机在线播放-17c久久精品国产亚洲av-久久国产一区二区三区高清视频-久久久久综合亚洲伊人 | 日韩一二三区视频免费在线观看-少妇人妻精品午夜码-日韩免费视频毛片-亚洲激情制服诱惑网 | 韩日国一二三区中文字幕-91麻豆精品美女诱惑-久久久精品免费网站-蜜臀久久国产精品av | 素人搭讪按摩中出中文字幕在线观看-国产av毛片一区二区三区麻豆-蜜臀久久精品久久久久酒店-天天干天天操天天干天天日 | 国内精品伊人久久久av高清影-91久久国产精品小视频-内射中文字幕精品电影-熟女人妻中文字幕久久久边 | 51精产国品一二三产区区-亚洲视频av在线看-一区二区三区熟妇人妻少妇-日韩激情第三页 | 蜜桃激情一区二区三区大全-日韩欧美成人中文字幕在线国产丝袜美腿-亚洲黄涩视频在线观看-日韩一区二区三区激情 | 69人妻精品久久久久88-欧美日韩一级二级片-av国产剧情md精品麻豆-成人福利在线观看免费视频 |