Correcting teacher:PHPz
Correction status:qualified
Teacher's comments:
//一级循环成功
foreach($arr as $key=>$value){
echo $value['area_id'];
echo '--';
echo $value['area_pid'];
echo '--';
echo $value['area_name'];
echo '--';
echo $value['lng'];
echo '--';
echo $value['lat'];
echo '<hr>';
}
//打印输出
print_r($arr);
//二级循环成功
foreach($arr as $key => $value){
foreach($value as $key_two => $value_two){
echo $value['area_id'];
echo '--';
echo $value['area_pid'];
echo '--';
echo $value['area_name'];
echo '--';
echo $value['lng'];
echo '--';
echo $value['lat'];
echo '<hr>';
}
}
//打印输出
print_r($arr);
//三级循环成功
foreach($arr as $key => $value){
foreach($value as $key_a => $value_a){
foreach($value as $key_b => $value_b){
echo $value['area_id'];
echo '--';
echo $value['area_pid'];
echo '--';
echo $value['area_name'];
echo '--';
echo $value['lng'];
echo '--';
echo $value['lat'];
echo '<hr>';
}
}
}
//打印输出
print_r($arr);
//四级循环成功
foreach($arr as $key => $value){
foreach($value as $key_a => $value_a){
foreach($value as $key_b => $value_b){
foreach($value as $key_c => $value_c){
echo $value['area_id'];
echo '--';
echo $value['area_pid'];
echo '--';
echo $value['area_name'];
echo '--';
echo $value['lng'];
echo '--';
echo $value['lat'];
echo '<hr>';
}
}
}
}
//打印输出
print_r($arr);
//五级循环成功
foreach($arr as $key => $value){
foreach($value as $key_a => $value_a){
foreach($value as $key_b => $value_b){
foreach($value as $key_c => $value_c){
foreach($value as $key_d => $value_d){
echo $value['area_id'];
echo '--';
echo $value['area_pid'];
echo '--';
echo $value['area_name'];
echo '--';
echo $value['lng'];
echo '--';
echo $value['lat'];
echo '<hr>';
}
}
}
}
}
//打印输出
print_r($arr);