以下是一个使用PHP语言编写的成绩管理系统实例,通过表格形式展示学生的成绩情况。
```php

// 定义学生数据数组
$students = [
[
'name' => '张三',
'chinese' => 80,
'math' => 90,
'english' => 70,
],
[
'name' => '李四',
'chinese' => 85,
'math' => 88,
'english' => 75,
],
[
'name' => '王五',
'chinese' => 78,
'math' => 82,
'english' => 79,
],
];
// 计算平均分
foreach ($students as $student) {
$totalScore = $student['chinese'] + $student['math'] + $student['english'];
$student['average'] = $totalScore / 3;
}
// 按平均分降序排列学生数据
usort($students, function($a, $b) {
return $b['average'] - $a['average'];
});
// 输出学生成绩表格
echo "









