ch循环遍历数组$sum
{
list($stu_number,$stu_name,$stu_score)=$value; //使用list()函数将数组中的值赋给变量
//输出表格内容
echo "<tr><td>$stu_number</td><td>$stu_name</td><td>$stu_score</td></tr>";
}
echo "</table><br>"; //表格尾部
reset($sum); //重置$sum数组的指针
while(list($key,$value)=each($sum)) //使用while循环遍历数组
{
list($stu_number,$stu_name,$stu_score)=$value;
if($stu_number=="081101") //
查询是否有学号为081101的值
{
echo "<center><font size=4 color=red>";
echo $stu_number."的姓名为:".$stu_name.",";
echo "成绩为:".$stu_score;
break; //找到则结束循环
}
}
}
?>