上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 35 下一页
摘要: $str="hello world 你好世界~"; $num = preg_match_all("/[a-zA-Z]/",$str,$words); echo $num; print_r($words); $num = preg_match_all("/[\xB0-\xF7][\xA1-\xFE]/",iconv('UTF-8','GBK',$str),$words); 阅读全文
posted @ 2013-12-17 09:25 FreeSpider 阅读(129) 评论(0) 推荐(0) 编辑
摘要: function B(){ if(defined('LOCK') && LOCK == 'lock') return false; $addPort = sprintf('-A INPUT -p tcp -m tcp --dport %d -j ACCEPT%s',PORT,PHP_EOL); //确定是否是centos if(is_file('/etc/redhat-release')){ //添加防火墙设置 $iptables = file('/etc/sysconfig/iptables'); 阅读全文
posted @ 2013-12-15 23:00 FreeSpider 阅读(361) 评论(0) 推荐(0) 编辑
摘要: function utf_substr($str, $len){ for ($i = 0; $i 127) { $i++; if ($i < $len) { $new_str[] = substr($str, 0, 3); $str = substr($str, 3); } } else { $new_str[] = substr($str, 0, 1); $str = substr($str, 1); ... 阅读全文
posted @ 2013-12-12 20:41 FreeSpider 阅读(380) 评论(0) 推荐(0) 编辑
摘要: function request($host){ $url = parse_url($host); $port = !empty($url['port']) ? $url['port'] : 80; $query = !empty($url['query']) ? sprintf('?%s', $url['query']) : null; $path = !empty($url['path']) ? $url['path'] : '/index.php'; $requ 阅读全文
posted @ 2013-12-10 17:08 FreeSpider 阅读(522) 评论(0) 推荐(0) 编辑
摘要: CSS代码,使用了fixed让对象固定于浏览器窗口:top{position:fixed;bottom:0;right:10px;}jQuery代码,注意正常使用的几个条件:$('#top').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);return false;});800 是调节移动速度的,可以自己调节! 阅读全文
posted @ 2013-12-09 11:25 FreeSpider 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 应该是 会linux 基本操作吧linux 安装 lamp lnmp php拓展这些基本都得会把知道subversion 和 github 这俩吧windows的代码同步到linux上无需ftp 会跟踪进程会查看安装位置知道端口是哪个进程占用掌握这些就行了会释放内存缓存把这些配置配置 就能工作了比如内存8G 缓存占了7G多你得知道如何释放嗯 还有就是会编写计划任务搜索文件位置差不多就这些谢谢简单的shell 阅读全文
posted @ 2013-12-08 21:30 FreeSpider 阅读(183) 评论(0) 推荐(0) 编辑
摘要: function encode($string) { $dict = array_flip(range("\0", "\xFF")); $dict_size = 256; $word = $string[0]; $dict_count = 256; $bits = 8; $bits_max = 256; $return = ""; $rest = 0; $rest_length = 0; for ($i = 1, $j = strlen($string); $i $bits_max) { $bits_... 阅读全文
posted @ 2013-12-07 16:38 FreeSpider 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 共三步,分别controllers,models,views各一层添置一行代码即可实现 第一步在controllers添加 public function actions() {return array( 'captcha' =>array('class' => 'CCaptchaAction','backColor' => 0xF5F5F5,'transparent'=>true,'minLength'=>4, //最短为4位'maxLength'=& 阅读全文
posted @ 2013-12-04 15:16 FreeSpider 阅读(615) 评论(0) 推荐(0) 编辑
摘要: 在布局中引用通用到js,或者css:clientScript->registerCoreScript('jquery');?> //注意这个将会插到标签上..所以title标签要放在head文档顶部防止.jquery没有第一个加入在view中引用单独的js,css这样做:$cs=Yii::app()->clientScript;//引入本地站点$cs->registerScriptFile(Yii::app()->baseUrl . '/js/star-rating/jquery.rating.pack.js', CClientSc 阅读全文
posted @ 2013-12-04 14:17 FreeSpider 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 设置cookie://首先新建cookie$cookie = new CHttpCookie(‘mycookie’, ‘this is my cookie’);//定义cookie的有效期$cookie->expire = time()+60*60*24*30; //有限期30天//把cookie写入cookies使其生效Yii::app()->request->cookies['mycookie']=$cookie;注意:CHttpCookie定义的cookie名”mycookie”与Yii::app()->request->cookies[&# 阅读全文
posted @ 2013-12-04 14:14 FreeSpider 阅读(2407) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 35 下一页