1.定义默认一维数组
//$easy=array('one','two','three');
echo $easy[0];
当定义一维数组时若未直接定义键名默认为0,1...
2.定义自定义键名的一维数组
$medium =array('one'=>'1','two'=>'2','three'=>'3');
echo $medium['one'];
3.定义普通二维数组
$sample=array(
array('1','2','3'),
array('4','5','6')
);
echo $sample[0][0];
4.定义自定义二维数组
$medium =array(
'one'=>array('one'=>'1','two'=>'two'),
'two'=>array('two'=>'two','three'=>'three')
);
echo $medium ['one']['one'];