php案例
目录
01.假期表格
02.表格标注
03.双重for循环打印九九乘法表
04.记事本案例
一、假期表格 返回顶部
要求:创建数组 vacation,用于存储一年中的所有假期名称和放假天数,并使用表格展示出来
效果:
代码:
<?php
$vacation = [
['name' => '元旦', 'day' => '3'],
['name' => '春节', 'day' => '7'],
['name' => '清明', 'day' => '3'],
['name' => '五一', 'day' => '3'],
['name' => '端午', 'day' => '3'],
['name' => '国庆', 'day' => '7']
];
?>
<table>
<thead>
<tr>
<th>假期名称</th>
<th>放假天数</th>
</tr>
</thead>
<tbody>
<?php foreach ($vacation as $v