一个基础编程,谢谢啦!

And1.moc 2019-11-19 10:21:52
用PHP展示如下图所示学生信息表,将代码及运行结果拍照上传。 学号 姓名 性别 出生日期 班级 学号 姓名 性别 出生日期 班级 总分 G18101301 张三 女 2000-9-1 计应181 379 G18101302 李四 男 1999-12-10 软件182 308 G18101303 王五 女 2000-5-19 软件185 286 G18101304 赵六 男 2000-6-3 计网182 295 G18101305 陈七 男 19999-10-6 计应182 276
...全文
76 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
1002710030 2019-11-29
  • 打赏
  • 举报
回复
引用 2 楼 xuanziran 的回复:
运行截图:


源代码:

<?php
$config = array(
0 => array(
'student_id' => 'G18101301',
'name' => '张三',
'gender' => '女',
'date_of_birth' => '2000-9-1',
'class' => '计应181',
'total_points' => 379
),
1 => array(
'student_id' => 'G18101302',
'name' => '李四',
'gender' => '男',
'date_of_birth' => '1999-12-10',
'class' => '软件182',
'total_points' => 308
),
2 => array(
'student_id' => 'G18101303',
'name' => '王五',
'gender' => '女',
'date_of_birth' => '2000-5-19',
'class' => '软件185',
'total_points' => 286
),
3 => array(
'student_id' => 'G18101304',
'name' => '赵六',
'gender' => '男',
'date_of_birth' => '2000-6-3',
'class' => '计网182',
'total_points' => 295
),
4 => array(
'student_id' => 'G18101305',
'name' => '陈七',
'gender' => '男',
'date_of_birth' => '1999-10-6',
'class' => '计应182',
'total_points' => 276
)
);

echo '
<table border="1">
<tr>
<th>学号</th>
<th>姓名</th>
<th>性别</th>
<th>出生日期</th>
<th>班级</th>
<th>总分</th>
</tr>
';
for($i = 0; $i < count($config); $i++) {
echo '<tr>';
foreach($config[$i] as $v) {
echo "<td>$v</td>";
}
echo '</tr>';
}
echo '</table>';

/*
学号 姓名 性别 出生日期 班级 总分
G18101301 张三 女 2000-9-1 计应181 379
G18101302 李四 男 1999-12-10 软件182 308
G18101303 王五 女 2000-5-19 软件185 286
G18101304 赵六 男 2000-6-3 计网182 295
G18101305 陈七 男 1999-10-6 计应182 276
*/
手机电量颜色很炫嘛
于小九 2019-11-20
  • 打赏
  • 举报
回复
运行截图:


源代码:

<?php
$config = array(
0 => array(
'student_id' => 'G18101301',
'name' => '张三',
'gender' => '女',
'date_of_birth' => '2000-9-1',
'class' => '计应181',
'total_points' => 379
),
1 => array(
'student_id' => 'G18101302',
'name' => '李四',
'gender' => '男',
'date_of_birth' => '1999-12-10',
'class' => '软件182',
'total_points' => 308
),
2 => array(
'student_id' => 'G18101303',
'name' => '王五',
'gender' => '女',
'date_of_birth' => '2000-5-19',
'class' => '软件185',
'total_points' => 286
),
3 => array(
'student_id' => 'G18101304',
'name' => '赵六',
'gender' => '男',
'date_of_birth' => '2000-6-3',
'class' => '计网182',
'total_points' => 295
),
4 => array(
'student_id' => 'G18101305',
'name' => '陈七',
'gender' => '男',
'date_of_birth' => '1999-10-6',
'class' => '计应182',
'total_points' => 276
)
);

echo '
<table border="1">
<tr>
<th>学号</th>
<th>姓名</th>
<th>性别</th>
<th>出生日期</th>
<th>班级</th>
<th>总分</th>
</tr>
';
for($i = 0; $i < count($config); $i++) {
echo '<tr>';
foreach($config[$i] as $v) {
echo "<td>$v</td>";
}
echo '</tr>';
}
echo '</table>';

/*
学号 姓名 性别 出生日期 班级 总分
G18101301 张三 女 2000-9-1 计应181 379
G18101302 李四 男 1999-12-10 软件182 308
G18101303 王五 女 2000-5-19 软件185 286
G18101304 赵六 男 2000-6-3 计网182 295
G18101305 陈七 男 1999-10-6 计应182 276
*/
程序猿视界 2019-11-19
  • 打赏
  • 举报
回复
小老弟啊,你这样怕是不行的啊,老师布置的作业,最基础的东西,还是自己动动手把!

21,882

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧