<?php $arr=array( '教学部'=>array( array('李某','18','人妖'), array('高某','20','男'), array('张某','21','妖人'), ), '宣传部'=>array( array('李某','18','人妖'), array('高某','20','男'), array('张某','21','妖人'), ), '财务部'=>array( array('李某','18','人妖'), array('高某','20','男'), array('张某','21','妖人'), ), ); foreach($arr as $value){ foreach($value as $a=>$b){ echo "$a---$b</br>"; } echo '------</br>'; } ?>
This is a three-dimensional array. What you get after traversing the second time is still an array. You need to print_r to print it, or add another traversal inside it