//forループを使用して走査します
$arr2=array(array("Zhang San","20", "男性"),array ("李思","25","男性"),array("王五","19","女性"),array("趙劉","25","女性") "));
echo "
名前 | 年齢 | 性別 | < ;/tr>gt ;";
for($i=0;$i<4;$i++){
echo "
";
for($j=0;$j<3;$j++){
echo ""; echo $arr2[$i][$j]; echo " | ";
}
echo "
";
echo "
";
}
echo "
";
?>
$arr = array(' one'=>array('name'=>'張三','年齢'=>'23','性別'=>'男性'),
'two' =>array('name '=>'李四','年齢'=>'43','性別'=>'女'),
'三'=>array('名前'= >'王五', '年齢'=>'32','性別'=>'男性'),
'four'=>array('名前'=>'趙劉','年齢'=>'12' ,'性別'=>'女性'));
foreach($arr as $k=>$val){
echo $val['name'].$val['age'].$val['sex']."
";
}
echo "
";
?>
$arr = array('one'=>array( 'name' =>'張三','年齢'=>'23','性別'=>'男性'),
'two'=>array('name'=>'李思',' 年齢'=>'43','性別'=>'女性'),
'three'=>array('名前'=>'王五','年齢'=>' 32', '性別'=>'男性'),
'four'=>array('名前'=>'趙劉','年齢'=>'12','性別'=> '女性' ));
foreach($arr as $key=>$value){
foreach($value as $key2=>$value2){
echo $value2;
}
echo "
";
}
?>