Blogger Information
Blog 250
fans 3
comment 0
visits 321547
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
数组:直接使用[]方法进行声明
梁凯达的博客
Original
815 people have browsed it

数组可以直接用[]的方式进行声明。但是需要注意的是。

直接利用:变量 = [数组]

这样的方式去声明一个数组的时候,只有在PHP5以上的版本才支持,PHP5一下的版本并不支持这种方式。

方式为:

$num = [1,2,3,4,5,6];

$num = [1=>'数组键1',2=>'数组键2'];

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post