PHP
a[]和
a的区别
$a[]=array('b'=>'b','c'=>'c');
$b=array('b'=>'b','c'=>'c');
echo $a[0]['c'];
echo $b['c'];
也就是说$a[]本身就是一个数组,被array()赋值以后ibanchengle二维数组
$a = array(1, 2, 3);
$a[] = 5;
这时,输出$a,Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 5 )
$a = array();
$a[] = 1;
这时,输出$a,Array ( [0] => 1 )