给数组赋值要用双引号还是不用加双引号?
你的名字
你的名字 2016-12-17 13:20:36
0
4
3783

比如:

var arr=new Array();

arr[0]=这里加不加双引号呀

你的名字
你的名字

reply all(4)
钟毅

arr[0]=The following mainly depends on what type of data content you want to put. For numeric types, no explicit annotation is required. Characters and symbols must be enclosed in double quotes. Of course, if your subscript is a character, you need to add double quotes. This requires special attention. The variable must specify the type of storage. PHP is automatically transformed.

数据分析师

Should we use double quotes or not when assigning values ​​to an array? - PHP Chinese website Q&A - Should we use double quotes or not when assigning values ​​to an array? - PHP Chinese website Q&A

Take a look around and learn.

蝎子

The key name in the array is a variable, and the key value is equivalent to the value of the variable. If there is no variable in a string, it is best to add single quotes. Double quotes will parse the variable, which can be slower according to logic

阿神

如果是给数组添加数字型 则可以不加双引号 arr[0] =99;

要是字符串的话就得加上双引号或单引号 : arr[1] = ‘张三’;

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template