<?php$arr=array( '教學部'=>array( array('李1','18','人妖'), array('高1','20'), array('高1','20','高1','20',' 男'), array('張1','21','妖人'), ), '宣傳部'=>array( array(李 2','20','男'), array('張2','21','妖人'), ), '財務部'=>array( '人妖'), array('高3','20','男'), array('張某','21','妖人'), ),);foreach($arr as $k=> ;$a){echo'<table width="500" border="1">'; echo $k ; = >$e){ $ .'</td>'; } lt ;/table>'; } ?>
autoload2021-09-06 09:42:23
foreach($arr as $k=>$a) { echo''; echo $k ; foreach($a as $b=>$c){ echo "<tr>"; foreach($c as $d=>$e){ $i=list($one,$two,$three)=$e; echo ''.$i.''; echo "</tr>"; } } echo ''; }
在第一層foreach內部的開始與結束分別加上
與即可