• 技术文章 >后端开发 >php教程

    php实现的CSS更新类实例,phpcss更新实例_PHP教程

    2016-07-13 10:18:28原创504

    php实现的CSS更新类实例,phpcss更新实例


    本文实例讲述了php实现的CSS更新类及其用法,非常实用。分享给大家供大家参考。具体如下:

    CSSUpdate.class.php类文件如下:

    <?php 
    /** css 更新类,更新css文件内图片的版本 
    *  Date:  2013-02-05 
    *  Author: fdipzone 
    *  Ver:  1.1 
    * 
    *  Func: 
    *  update(); 
    * 
    *  Ver:  1.1 增加search_child参数,可遍历子文件夹 
    */ 
     
    class CSSUpdate{ 
     
      private $csstmpl_path = null; 
      private $css_path = null; 
      private $replacetags = array(); 
      private $search_child = false; 
      private $convert_num = 0; 
      private $is_ready = 0; 
     
      /** 初始化 
      * @param String $csstmpl_path css模版路径 
      * @param String $css_path   css目标路径 
      * @param Array  $replacetags 需要替换的图片类型 
      * @param boolean $search_child 是否遍历子文件夹,默认false 
      */ 
      public function __construct($csstmpl_path, $css_path, $replacetags=array(), $search_child=false){ 
        if(!is_dir($csstmpl_path) || !is_dir($css_path) || !$replacetags){ 
          $this->is_ready = 0; 
        }else{ 
          $this->csstmpl_path = $csstmpl_path; 
          $this->css_path = $css_path; 
          $this->replacetags = $replacetags; 
          $this->search_child = $search_child; 
          $this->is_ready = 1; 
        } 
      } 
     
      /** 更新css文件 */ 
      public function update(){ 
        if($this->is_ready==0){ 
          $this->response('csstmpl or csspath or replacetags error'); 
          return ''; 
        } 
        $this->traversing($this->csstmpl_path); 
        $this->response('covert num:'.$this->convert_num); 
      } 
     
      /** 遍历文件夹 
      * @param String $path 文件路径 
      */ 
      private function traversing($path){ 
        $handle = opendir($path); 
        while(($file=readdir($handle))!==false){ 
          if($file!='..' && $file!='.'){ 
            $curfile = $path.'//m.sbmmt.com/m/'.$file; 
             
            if(is_dir($curfile)){  // folder 
              if($this->search_child){  // 需要遍历子文件夹 
                $this->traversing($curfile); 
              } 
            }elseif($this->checkExt($curfile)){ // css file 
              $dfile = str_replace($this->csstmpl_path, $this->css_path, $curfile); 
              $this->create($curfile, $dfile); 
              $this->response($curfile.' convert to '.$dfile.' success'); 
              $this->convert_num ++; 
            } 
          } 
        } 
        closedir($handle); 
      } 
     
      /** 检查文件后缀 */ 
      private function checkExt($file){ 
        $name = basename($file); 
        $namefrag = explode('.', $name); 
        if(count($namefrag)>=2){ 
          if(strtolower($namefrag[count($namefrag)-1])=='css'){ // css文件 
            return true; 
          } 
        } 
        return false; 
      } 
     
      /** 替换模版内容,写入csspath 
      * @param String $tmplfile 模版文件 
      * @param String $dfile  目标文件 
      */ 
      private function create($tmplfile, $dfile){ 
        $css_content = file_get_contents($tmplfile); 
        foreach($this->replacetags as $tag){ 
          $css_content = str_replace($tag, $tag."?".date('YmdHis'), $css_content); 
        } 
        if(!is_dir(dirname($dfile))){  // 生成目标路径 
          mkdir(dirname($dfile), 0755, true); 
        } 
        file_put_contents($dfile, $css_content, true); 
      } 
     
      /** 输出 */ 
      private function response($content){ 
        echo $content."
    "; } } ?>

    demo示例程序如下:

    <?php 
    require_once "CSSUpdate.class.php"; 
     
    define('ROOT_PATH', dirname(__FILE__)); 
    $css_path = ROOT_PATH.'/css'; 
    $csstmpl_path = ROOT_PATH.'/csstmpl'; 
    $replacetags = array('.png', '.jpg', '.gif'); 
     
    $cssobj = new CSSUpdate($csstmpl_path, $css_path, $replacetags); 
    $cssobj->update(); 
    ?>
    
    

    完整源码点击此处本站下载。

    希望本文所述对大家PHP程序设计的学习有所帮助。


    PHP通过css改变显示内容,答案正确另加50

    我用javascript完成的
    ============ first.html ===========



    first.html</title><br /></head><br /><body><br /><form action="second.html" method="get" name="myform"><br /> <input name="csstype" type="text" /><br /> <input name="submit" type="submit" /><br /></form><br /></body><br /></html><br /><br />============ second.html ==================<br /><br /><html><br /><head><br /><title>second.html</title><br /><style type="text/css"><br />.type1 h1 {<br /> color:#f00;<br />}<br />.type1 p {<br /> color:#0f0;<br />}<br />.type2 h1 {<br /> color:#ffff00;<br />}<br />.type2 p {<br /> color:#00ffff;<br />}<br />.type3 h1 {<br /> color:#ff00ff;<br />}<br />.type3 p {<br /> color:#ff00ff;<br />}<br /></style><br /></head><br /><body><br /><div id="wrap"><br /> <script type="text/javascript" language="javascript"><br />function QueryString(item){<br /> var sValue=location.search.match(new RegExp("[\?\&]"+item+"=([^\&]*)(\&?)","i"))<br /> return sValue?sValue[1]:sValue<br />}<br />var csstype=QueryString('csstype');<br />var wrap=document.getElementById("wrap")<br />switch(csstype)<br />{<br /> case "2":<br /> wrap.className="type2";<br /> break;<br /> case "3":<br /> wrap.className="type3";<br /> break;<br /> default:<br /> wrap.className="type1";<br />}<br /></script><br /> <h1>标题</h1><br /> <p>正文正文正文<......余下全文>><br/>  </br> <div class="header2"><span class="icon i-relatedanswer"><h3>php 怎可以动态获取css里面的数据,例如:动态的改变宽度与高度</h3></span></div><div class="best-replyer"></div> <p class="ft p1">这个应该是在html页面需要用javascript来获取的啊,你服务器语言怎么去获取人家浏览器里运行的html页面的css。<br /><div id="test" style="background-color: red;"></div><br /><script type="text/javascript"><br />document.write(document.getElementById( "#test" ).style.backgroundColor);<br /></script><br />应该是像这样获取的,如果你服务器硬是需要这些信息,就用ajax或者表单再传回给服务器的php页面<br/>  </br></p> <p align="left"><div style="display:none;"><span id="url" itemprop="url">http://www.bkjia.com/PHPjc/882902.html</span><span id="indexUrl" itemprop="indexUrl">www.bkjia.com</span><span id="isOriginal" itemprop="isOriginal">true</span><span id="isBasedOnUrl" itemprop="isBasedOnUrl">http://www.bkjia.com/PHPjc/882902.html</span><span id="genre" itemprop="genre">TechArticle</span><span id="description" itemprop="description">php实现的CSS更新类实例,phpcss更新实例 本文实例讲述了php实现的CSS更新类及其用法,非常实用。分享给大家供大家参考。具体如下: CSSU...</span></div></p></div> <div class="art_confoot"></div> <div class='bg-white layui-clear' style="margin:15px 0;"><span style="color:red;">声明:</span>本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。</div><div class='tags bg-white layui-clear pt-5'><span>专题推荐:</span><a href="//m.sbmmt.com/m/search?word=php">php</a> <a href="//m.sbmmt.com/m/search?word=css">CSS</a> <a href="//m.sbmmt.com/m/search?word=php">php</a></div><div><span style="display:inline-block; width: 100%; margin-top: 10px;"> 上一篇:<a style="color: #00AEEF;" href="//m.sbmmt.com/m/article/293707.html">php实现的Cookies操作类实例,phpcookies类实例_PHP教程</a></span><span style="display:inline-block; width: 100%"> 下一篇:<a style="color: #00AEEF;" href="//m.sbmmt.com/m/course/1467.html">自己动手写 PHP MVC 框架(40节精讲/巨细/新人进阶必看)</a></span></div></article><!--<div class="selectButton"><button type="button">点击阅读全文</button></div>--><!--<a href="javascript:;" onclick="location.href='https://m.xp.cn/'" rel="nofollow"><img src="//m.sbmmt.com/m/static/images/articlead.jpg" width="100%" alt="phpstudy集成环境下载"></a>--><!--<a href="//m.sbmmt.com/m/vip_mobile.html" rel="nofollow"><img src="//m.sbmmt.com/m/static/images/articlead1.gif" width="100%" alt="会员特权"></a>--></div><div id="phpad" style="max-width:640px; height:auto; min-height: 10px;"><a href="//m.sbmmt.com/jump/go.php?url=https%3A%2F%2Fm.sbmmt.com%2Fk.html&location=mob-banner-vue"><img src="//m.sbmmt.com/img/upload/aroundimg/000/000/001/63a01f357f088211.png" width="100%" /></a></div><div class='course-list bg-white layui-clear'><h4>相关文章推荐</h4><a href='//m.sbmmt.com/m/article/500523.html' title="聊聊ChatGPT是啥?PHP怎么使用ChatGPT?" class='alist'>• 聊聊ChatGPT是啥?PHP怎么使用ChatGPT?</a><a href='//m.sbmmt.com/m/article/500302.html' title="一文详解PHP用流方式实现下载文件(附代码示例)" class='alist'>• 一文详解PHP用流方式实现下载文件(附代码示例)</a><a href='//m.sbmmt.com/m/article/500311.html' title="PHP反序列化入门总结(小白必看)" class='alist'>• PHP反序列化入门总结(小白必看)</a><a href='//m.sbmmt.com/m/article/499988.html' title="PHP原生类的总结分享" class='alist'>• PHP原生类的总结分享</a><a href='//m.sbmmt.com/m/article/499950.html' title="聊聊PHP escapeshellarg函数使用的中文问题" class='alist'>• 聊聊PHP escapeshellarg函数使用的中文问题</a></div><div class="wwads-cn wwads-horizontal" data-id="164" style="max-width:640px"></div><!-- <script type="text/javascript" src="//m.sbmmt.com/sw/hezuo/cf85c41f1b0ce5f8359e5229784c31e4.html" ></script> --><div class='course-list bg-white layui-clear mt-10 mb-30'><ul ><h4>相关课程推荐</h4><li class='layui-clear' style="padding-left: 0px;"><a href="//m.sbmmt.com/m/course/386.html" class="course-arctic-img"><img src='//m.sbmmt.com/img/upload/course/000/000/001/5d1c6df423564706.jpg' height="100%"></a><div class='course-intro' style="margin-left: 0px;"><h2><a href="//m.sbmmt.com/m/course/386.html">独孤九贱(3)_JavaScript视频教程</a></h2><p class='course-intro-info'>javascript是运行在浏览器上的脚本语言,连续多年,被评为全球最受欢迎的编程语言。是前端开发必备三大法器中,最具杀伤力。如果前端开发是降龙十八掌,好么javascript就是第18掌:亢龙有悔。没有它,你的前端生涯是不完整的。《php.cn独孤九贱(3)-JavaScript视频教程》课程特色:php中文网原创幽默段子系列课程,以恶搞,段子为主题风格的php视频教程!轻松的教学风格,简短的教学模式,让同学们在不知不觉中,学会了javascript知识。</p><p><a href="//m.sbmmt.com/m/course/list/17.html"><span class='level'>JavaScript教程</span></a><span class='count'>142295次播放</span></p></div></li><hr><li class='layui-clear' style="padding-left: 0px;"><a href="//m.sbmmt.com/m/course/582.html" class="course-arctic-img"><img src='//m.sbmmt.com/img/upload/course/000/000/001/5d1c6e0d2b744633.jpg' height="100%"></a><div class='course-intro' style="margin-left: 0px;"><h2><a href="//m.sbmmt.com/m/course/582.html">独孤九贱(6)_jQuery视频教程</a></h2><p class='course-intro-info'>jQuery是一个快速、简洁的JavaScript框架。设计的宗旨是“write Less,Do More”,即倡导写更少的代码,做更多的事情。它封装JavaScript常用的功能代码,提供一种简便的JavaScript设计模式,优化HTML文档操作、事件处理、动画设计和Ajax交互。 核心特性可以总结为:具有独特的链式语法和短小清晰的多功能接口;具有高效灵活的css选择器,并且可对CSS选择器进行扩展;拥有便捷的插件扩展机制和丰富的插件。兼容各种主流浏览器,如IE 6.0+、FF 1.5+、Safari 2.0+、Opera 9.0+等,是全球最流行的前端开发框架之一。PHP中文网根据最新版本,独家录制jQuery最新视频教程,回馈PHP中文网的新老用户。</p><p><a href="//m.sbmmt.com/m/course/list/19.html"><span class='level'>jQuery教程</span></a><span class='count'>116798次播放</span></p></div></li><hr><li class='layui-clear' style="padding-left: 0px;"><a href="//m.sbmmt.com/m/course/1195.html" class="course-arctic-img"><img src='//m.sbmmt.com/img/upload/course/000/000/015/612f16c1e1c8e978.jpg' height="100%"></a><div class='course-intro' style="margin-left: 0px;"><h2><a href="//m.sbmmt.com/m/course/1195.html">jQuery与Ajax基础与实战</a></h2><p class='course-intro-info'>jQuery是最流行的JS函数库,封装了许多实用的功能,其中最引人入胜的就是Ajax。 jQuery中的Ajax操作,语法简单,操作方便,使Ajax从未如此轻松,前端人员从此不再为与服务器异步交互而发愁,本套课程,精选了最常用的几个方法,从基本的语法到每个参数,再到具体实例进行了全面的讲解。</p><p><a href="//m.sbmmt.com/m/course/list/25.html"><span class='level'>AJAX教程</span></a><span class='count'>16508次播放</span></p></div></li><hr><li class='layui-clear' style="padding-left: 0px;"><a href="//m.sbmmt.com/m/course/1313.html" class="course-arctic-img"><img src='//m.sbmmt.com/img/upload/course/000/000/015/617b8f8af2b97409.jpg' height="100%"></a><div class='course-intro' style="margin-left: 0px;"><h2><a href="//m.sbmmt.com/m/course/1313.html">Git教程(60分钟全程无废话版)</a></h2><p class='course-intro-info'>Git 是一个开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目。 Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。 Git 与常用的版本控制工具 CVS, Subversion 等不同,它采用了分布式版本库的方式,不必服务器端软件支持</p><p><a href="//m.sbmmt.com/m/course/list/17.html"><span class='level'>JavaScript教程</span></a><span class='count'>14226次播放</span></p></div></li><hr></ul></div><!-- <div class='discuss layui-clear bg-white'><h3>全部评论<span id='discuss-article'>我要评论</span></h3></div><div class='discuss-submit bg-white' url="//m.m.sbmmt.com/"><li class='info layui-clear'><span class='f-left' id='discuss-submit-close'>取消</span><span class='f-left'>发布评论</span><span class='f-right article-reply-publish' id="293708">发送</span></li><li class='layui-clear'><textarea type='text' rows="6" placeholder="请输入要评论的内容" class="article-reply-content-text"></textarea></li><li class='layui-clear'><button class="layui-btn layui-btn-danger f-right article-reply-publish-button">发布</button></li></div>--><div class='lock-screen' id='lock-screen'></div><div class='popimg-setting'><div>1/1</div><img src="" width='100%'></div><script src="//m.sbmmt.com/m/static/ueditor/third-party/SyntaxHighlighter/shCore.js"></script><script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script><footer><a href='//m.sbmmt.com/m/' ><i class='layui-icon layui-icon-home '></i>首页</a><a href='//m.sbmmt.com/m/course.html' ><i class='layui-icon layui-icon-play'></i>视频</a><a href='//m.sbmmt.com/m/mk.html?t=2'><img src="//m.sbmmt.com/img/upload/article/000/000/015/60ab3b6160ae1893.png" />直播</a><!-- <a href='//m.sbmmt.com/m/app/'><img src="//m.sbmmt.com/img/upload/article/000/000/003/6108e2ad07387877.png" style="width:20px;height:20px;" /><div style="margin-top:-5px;">下载</div></a>--><a href='//m.sbmmt.com/m/wenda.html' ><i class='layui-icon layui-icon-code-circle'></i>社区</a><a href='//m.sbmmt.com/m/login' ><i class='layui-icon layui-icon-username'></i>我的</a></footer><div class="headerMask"></div><div class="right_menu"><div class="right_menu_con" style="position:relative;"><h2 class="hjclass-txt"><i class="layui-icon layui-icon-shrink-right hjclass-txt-i"></i>PHP中文网</h2><div class="menu-list"><a href="//m.sbmmt.com/m/"><span class="item-icon item-1"><img src="//m.sbmmt.com/img/upload/article/000/000/003/5bffb65f99ae2304.png" alt="首页"></span> 首页</a><a href="//m.sbmmt.com/m/course.html"><span class="item-icon item-7"><img src="//m.sbmmt.com/img/upload/article/000/000/003/5bffb82bd09ad628.png" alt="课程"></span> 课程</a><a href="//m.sbmmt.com/m/article.html"><span class="item-icon item-4"><img src="//m.sbmmt.com/img/upload/article/000/000/003/5bffb7e111b3b425.png" alt="文章"></i></span>文章</a><a href="//m.sbmmt.com/m/wenda.html"><span class="item-icon item-2"><img src="//m.sbmmt.com/img/upload/article/000/000/003/5bffb83f04e24328.png" alt="问答"></span> 问答</a><a href="//m.sbmmt.com/m/blog.html"><span class="item-icon item-0"><img src="//m.sbmmt.com/m/static/images/ico/blog.png" alt="博客"></span>博客</a><a href="//m.sbmmt.com/m/dic.html"><span class="item-icon item-9"><img src="//m.sbmmt.com/img/upload/article/000/000/003/5bffb85047b25758.png" alt="词典"></span> 词典</a><a href="//m.sbmmt.com/m/course/type/99.html"><span class="item-icon item-3"><img src="//m.sbmmt.com/img/upload/article/000/000/003/5bffb8736ea90300.png" alt="手册"></span> 手册</a><a href="//m.sbmmt.com/m/xiazai/"><span class="item-icon item-5"><img src="//m.sbmmt.com/m/static/images/ico/resources.png" alt="资源"></span> 资源</a><a href="//m.sbmmt.com/m/search"><span class="item-icon item-6"><img src="//m.sbmmt.com/img/upload/article/000/000/003/5bffb880b460a204.png" alt="搜索"></span> 搜索</a><a href="//m.sbmmt.com/m/app/"><span class="item-icon item-6"><img src="//m.sbmmt.com/img/upload/article/000/000/003/608bbfa30d9cc398.png" style="width:35px;height:35px;" alt="APP下载"></span> APP下载</a></div><!-- <a href="//m.sbmmt.com/jump/go.php?url=https%3A%2F%2Fm.sbmmt.com%2Fmap%2F2.html&location=mob-mune-ad" style="display:block; position:absolute ; bottom:0px" target="_blank"><img src="//m.sbmmt.com/img/upload/aroundimg/000/000/001/62fdcfb67b3b8383.png" width="100%" /></a> --></div></div><script>isLogin = 0;</script><script type="text/javascript" src="//m.sbmmt.com/m/static/js/jquery.min.js"></script><script type="text/javascript" src="//m.sbmmt.com/m/static/layui/layui.js"></script><script type="text/javascript" src="//m.sbmmt.com/m/static/js/global.js?4.9.47"></script><script>(function () {var bp = document.createElement('script');var curProtocol = window.location.protocol.split(':')[0];if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';} else {bp.src = 'http://push.zhanzhang.baidu.com/push.js';}var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(bp, s);})();var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src = "https://m.sbmmt.com/hm.js?43f47cabf6856204df6d083dd89ae407";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();</script><link rel='stylesheet' id='_main-css' href='//m.sbmmt.com/m/static/css/viewer.min.css' type='text/css' media='all'/><script type='text/javascript' src='//m.sbmmt.com/m/static/js/viewer.min.js?1'></script><script type='text/javascript' src='//m.sbmmt.com/m/static/js/jquery-viewer.min.js'></script><script> // function called if wwads is blocked function ABDetected() { document.getElementsByClassName("wwads-cn")[0].insertAdjacentHTML("beforeend", "<style>.wwads-horizontal,.wwads-vertical{background-color:#f4f8fa;padding:5px;min-height:120px;margin-top:20px;box-sizing:border-box;border-radius:3px;font-family:sans-serif;display:flex;min-width:150px;position:relative;overflow:hidden;}.wwads-horizontal{flex-wrap:wrap;justify-content:center}.wwads-vertical{flex-direction:column;align-items:center;padding-bottom:32px}.wwads-horizontal a,.wwads-vertical a{text-decoration:none}.wwads-horizontal .wwads-img,.wwads-vertical .wwads-img{margin:5px}.wwads-horizontal .wwads-content,.wwads-vertical .wwads-content{margin:5px}.wwads-horizontal .wwads-content{flex:130px}.wwads-vertical .wwads-content{margin-top:10px}.wwads-horizontal .wwads-text,.wwads-content .wwads-text{font-size:14px;line-height:1.4;color:#0e1011;-webkit-font-smoothing:antialiased}.wwads-horizontal .wwads-poweredby,.wwads-vertical .wwads-poweredby{display:block;font-size:11px;color:#a6b7bf;margin-top:1em}.wwads-vertical .wwads-poweredby{position:absolute;left:10px;bottom:10px}.wwads-horizontal .wwads-poweredby span,.wwads-vertical .wwads-poweredby span{transition:all 0.2s ease-in-out;margin-left:-1em}.wwads-horizontal .wwads-poweredby span:first-child,.wwads-vertical .wwads-poweredby span:first-child{opacity:0}.wwads-horizontal:hover .wwads-poweredby span,.wwads-vertical:hover .wwads-poweredby span{opacity:1;margin-left:0}.wwads-horizontal .wwads-hide,.wwads-vertical .wwads-hide{position:absolute;right:-23px;bottom:-23px;width:46px;height:46px;border-radius:23px;transition:all 0.3s ease-in-out;cursor:pointer;}.wwads-horizontal .wwads-hide:hover,.wwads-vertical .wwads-hide:hover{background:rgb(0 0 0 /0.05)}.wwads-horizontal .wwads-hide svg,.wwads-vertical .wwads-hide svg{position:absolute;left:10px;top:10px;fill:#a6b7bf}.wwads-horizontal .wwads-hide:hover svg,.wwads-vertical .wwads-hide:hover svg{fill:#3E4546}</style><a href='https://wwads.cn/page/whitelist-wwads' class='wwads-img' target='_blank' rel='nofollow'><img src='https://creatives-1301677708.file.myqcloud.com/images/placeholder/wwads-friendly-ads.png' width='130'></a><div class='wwads-content'><a href='https://wwads.cn/page/whitelist-wwads' class='wwads-text' target='_blank' rel='nofollow'>为了本站的长期运营,请将我们的网站加入广告拦截器的白名单,感谢您的支持!</a><a href='https://wwads.cn/page/end-user-privacy' class='wwads-poweredby' title='万维广告 ~ 让广告更优雅,且有用' target='_blank'><span>万维</span><span>广告</span></a></div><a class='wwads-hide' onclick='parentNode.remove()' title='隐藏广告'><svg xmlns='http://www.w3.org/2000/svg' width='6' height='7'><path d='M.879.672L3 2.793 5.121.672a.5.5 0 11.707.707L3.708 3.5l2.12 2.121a.5.5 0 11-.707.707l-2.12-2.12-2.122 2.12a.5.5 0 11-.707-.707l2.121-2.12L.172 1.378A.5.5 0 01.879.672z'></path></svg></a>"); }; //check document ready function docReady(t) { "complete" === document.readyState || "interactive" === document.readyState ? setTimeout(t, 1) : document.addEventListener("DOMContentLoaded", t); } //check if wwads' fire function was blocked after document is ready with 3s timeout (waiting the ad loading) docReady(function () { setTimeout(function () { if( window._AdBlockInit === undefined ){ ABDetected(); } }, 3000); }); </script><script> var returnCitySN = ''; // document.getElementById("phpad").style.display="none"; // document.getElementById("phpcontent").style.display="none"; // document.getElementById("app_open").style.display="none"; </script><script type="text/javascript" charset="UTF-8" src="//m.sbmmt.com/ip/city.php?sign=0d49e58a4ae2ab4802b772857cf5e73b"></script><script> function setCookie(name,value,iDay){ //name相当于键,value相当于值,iDay为要设置的过期时间(天) var oDate = new Date(); oDate.setDate(oDate.getDate() + iDay); document.cookie = name + '=' + value + ';path=/;domain=.php.cn;expires=' + oDate; } //读cookies function getCookiea(name) { var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"); if(arr=document.cookie.match(reg)) return arr[2]; else return null; } // var ad = getCookiea('ad'); // if( returnCitySN == '' || encodeURIComponent(returnCitySN.cname).indexOf('%E6%96%B0%E7%96%86') != -1 || encodeURIComponent(returnCitySN.cname).indexOf('%E5%8C%97%E4%BA%AC') != -1) // { // $('#phpad').remove(); // $('#phpcontent').remove(); // $('#app_open').remove(); // } // else // { // setCookie('ad',1,1) // document.getElementById("phpad").style.display=""; // document.getElementById("phpcontent").style.display=""; // document.getElementById("app_open").style.display=""; // } </script><script>$('article').viewer({navbar:true,title:false,toolbar:false,movable:false,viewed:function(){$('img').click(function(){$('.viewer-close').trigger('click');});}});</script><script type="application/ld+json">{"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld","@id": "//m.m.sbmmt.com/article/293708.html","appid": "1549852514326010","title": "php实现的CSS更新类实例,phpcss更新实例_PHP教程","images": [""],"description": "php实现的CSS更新类实例,phpcss更新实例。php实现的CSS更新类实例,phpcss更新实例 本文实例讲述了php实现的CSS更新类及其用法,非常实用。分享给大家供大家参考。具体如下: CSSU","pubDate": "2016-07-13T10:18:28","data": {"WebPage": {"headline": "php实现的CSS更新类实例,phpcss更新实例_PHP教程","wapUrl": "//m.m.sbmmt.com/article/293708.html","pcUrl": "//m.sbmmt.com/m/php-weizijiaocheng-293708.html","fromSrc": "php中文网","domain": "电子科技","category": ["问答"],"isDeleted": 0},"Question": [{"acceptedAnswer":"php实现的CSS更新类实例,phpcss更新实例。php实现的CSS更新类实例,phpcss更新实例 本文实例讲述了php实现的CSS更新类及其用法,非常实用。分享给大家供大家参考。具体如下: CSSU"}],"ImageObject": [{"contentUrl": "","scale": "5:2"}],"Author": [{"name": "php中文网","jobTitle": ["php公益学习平台"],"headPortrait": "https://img.php.cn/upload/article/000/000/003/5d1b23156bf94358.png"}]}}</script><script>$('.selectButton').hide();</script><script> var href = window.location.href; var title = document.title; var num = Math.floor(Math.random() * 10000 + 1); var newscript = document.createElement('script'); newscript.setAttribute('type','text/javascript'); newscript.setAttribute('src',"https://analyze.xm6wpp.com/index.php/api/statistics/phpcn?url="+encodeURIComponent(href)+"&title="+encodeURIComponent(title)+"&"+num); var head = document.getElementsByTagName('head')[0]; head.appendChild(newscript); </script></body></html>