1.in_array 看代码 出乎意料,结果是yes,why? 查看php的官方文档 in_array 原来还有第三个参数,将第三个参数设置为true的时候,会要求数据类型一致。 默认是false,上面的案例将字符串'1nihao'强制转换成了1,检测出了错误的结果。 综上,以后检测的时候要添加最后 ...
分类:
Web程序 时间:
2016-06-24 12:19:19
阅读次数:
173
一、json写法以及获得其数据的方法 var jsons={ name:'wen', age:12, price:'qq' } console.log(typeof jsons);//object console.log(jsons.name);//wen 二、Array var arr=new A ...
分类:
编程语言 时间:
2016-06-24 12:17:59
阅读次数:
178
1.介绍js的基本数据类型 Undefined、Null、Boolean、Number、String 2.js有哪些内置对象? 数据封装类对象:Object、Array、Boolean、Number 和 String 其他对象:Function、Arguments、Math、Date、RegExp、 ...
分类:
Web程序 时间:
2016-06-24 12:13:39
阅读次数:
116
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex ...
分类:
其他好文 时间:
2016-06-24 10:48:58
阅读次数:
160
问题描述: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would h ...
分类:
其他好文 时间:
2016-06-24 10:47:07
阅读次数:
153
题目连接 https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ Convert Sorted Array to Binary Search Tree Description Given an array w ...
分类:
其他好文 时间:
2016-06-23 23:52:58
阅读次数:
138
<script language="javascript">//json数据特点//定义:花括号括起来,key和value成对存在,可以存任意类型数据var js={"one":"111","two":"222","three":new Array(1,2,3),"four":{a:1,b:2,c: ...
分类:
Web程序 时间:
2016-06-23 23:38:55
阅读次数:
207
1. 问题描述 Given an array of size n, find the majority element. The majority element is the element that appears more than ? n/2 ? times.You may assume t ...
分类:
其他好文 时间:
2016-06-23 22:18:42
阅读次数:
134
Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim ...
分类:
其他好文 时间:
2016-06-23 22:05:34
阅读次数:
113
题目来源:http://www.lintcode.com/zh-cn/problem/merge-sorted-array/ C++版 VS2012测试通过 Python2.7版 spider测试通过 ...
分类:
编程语言 时间:
2016-06-23 21:57:09
阅读次数:
197