Yii2 配置文件 常用配置总结 Yii2 配置文件 常用配置总结 <?php // 主配置文件 $config = array( 'modules' => array( 'gii' => array( 'class' => 'system.gii.GiiModule', 'password' => ...
分类:
其他好文 时间:
2016-10-26 20:04:59
阅读次数:
173
几个需要经常用到的类型判断: 自定义一个类似于typeof的函数,提供更多的类型判断。 如果传入的参数为null,则类型返回'null',基本上可以返回各种常用对象类型,如'function', 'array','regexp'……而不是统一返回object。 判断是否为函数类型: 判断是不是win ...
分类:
其他好文 时间:
2016-10-26 19:23:06
阅读次数:
143
function arrayToObject($e){ if( gettype($e)!='array' ) return; foreach($e as $k=>$v){ if( gettype($v)=='array' || getType($v)=='object' ) $e[$k]=(obje ...
分类:
编程语言 时间:
2016-10-26 19:15:16
阅读次数:
165
Problem: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For exa ...
分类:
其他好文 时间:
2016-10-26 13:30:09
阅读次数:
167
instanceof 可以用来确定实例与原型之间是否存在关系 只有当原型与实例有关系的时候 才能依赖于 instanceof 确定 colors的实际构造函数为 SpecialArray 里面的 Array 虽然是通过new SpecialArray 创建的实例 但实际上 跟SpecialArray ...
分类:
其他好文 时间:
2016-10-26 13:28:30
阅读次数:
146
$_SERVER is an array containing information such as headers, paths, and script locations. The entries in this array are created by the web server. The ...
分类:
其他好文 时间:
2016-10-26 13:20:36
阅读次数:
195
假设叫数组 $my_array; // 新建一个空的数组. $tmp_array = array(); $new_array = array(); // 1. 循环出所有的行. ( $val 就是某个行) foreach($my_array as $k => $val){ $hash = md5(j ...
分类:
编程语言 时间:
2016-10-26 11:23:21
阅读次数:
179
Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j]and the d ...
分类:
其他好文 时间:
2016-10-26 09:34:14
阅读次数:
187
非常不要脸地做一个easy,是fb面经= =……那个人人品也是可以 和remove duplicates from sorted array道理是一样的,用i对整个数组走一遍,然后用index保持有效的位置。最后把index及之后的都填成0就可以了 ...
分类:
其他好文 时间:
2016-10-26 09:21:56
阅读次数:
163
JS中的this 最近在学习JavaScript面向对象,其中有个难点就是关于this的问题。 关于this,我们要知道的两个问题,一个是this指向什么?另一个是this可以写在哪? 关于this的指向 总的来说,this指向对象,具体要分情况来说。 两个原则: 1、this的指向是运行时决定的; ...
分类:
Web程序 时间:
2016-10-26 07:19:37
阅读次数:
250