Correcting teacher:查无此人
Correction status:qualified
Teacher's comments:完成的不错。
创建数组
$arr =array ();
$arr= [];
创建索引数组
$arr = [
'欧阳大仙',
'法力无边',
'武功盖世',
]
访问输出
echo $arr[0];
echo $arr[1];
echo $arr[2];
创建关联数组
$arr = [
'oy' =>'欧阳大仙',
'fl' =>'法力无边',
'wg' =>'武功盖世',
]
访问输出
echo $arr['oy'];
echo $arr['oy'];
echo $arr['oy'];
二维数组
$arr = array (
$arr = array (
'oy' =>'欧阳大仙',
'fl' =>'法力无边',
'wg' =>'武功盖世',
)
//变三维
'js; =>[
'举世无双',
'一统江湖',
]
)
多维数组循环
foreach ($arr as $key => $v){
foreach ( $v as $key => $value) {
echo $value
echo '<hr>'
}
}
foreach ($arr as $key => $v ){
foreach ($v['js'] as $vv ){
echo $vv ;
}
}