php数组

<?php $arr1=array(0,1,2,3,4);
$arr2=array("a"=>0,"b"=>1,"c"=>2,"d"=>3,"e"=>4);//指定键和值,不设置键默认为按0起点索引 $arr3=array(array(0,1),array(2,3),array(4));

//array、foreach、list是语音结构,功能像函数 echo "\$arr1[0]=".$arr1[0];
echo "<br>";
echo "\$arr2[\"a\"]=".$arr2["a"];
echo "<br>";
echo "\$arr3[\"0\"][\"1\"]=".$arr3["0"]["1"];

?>

你可能感兴趣的:(php数组)