1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<table>
<thead>
<tr>
<th>일</th>
<th>월</th>
<th>화</th>
<th>수</th>
<th>목</th>
<th>금</th>
<th>토</th>
</tr>
</thead>
<tbody>
<?php
$data = $loop = [];
$data['start_date'] = "2019-10-29"; // 시작일
$data['end_date'] = "2019-11-14"; // 종료일
$sdate = date("Y-m-d", strtotime((date("w", strtotime($data['start_date'])) * -1)." day", strtotime($data['start_date'])));
$enum = 6 - date("w", strtotime($data['end_date']));
$edate = date("Y-m-d", strtotime($enum." day", strtotime($data['end_date'])));
for($i = 0; $date < $edate; $i++) {
$date = date("Y-m-d", strtotime($sdate." +".$i."days"));
if($i % 7 == 0) echo "<tr>";
echo "<td>".$date."</td>";
if($i % 7 == 6) echo "</tr>";
}
?>
</tbody>
</table>
|
cs |