我有两个相同的带有foreach循环的html表。一个数据库表,我想获取这些表的值,但是我想将它们分开,所以
在表1中,存在一月份添加的值。这样可能吗?
日期字段格式为:
// 2018-12-09 06:54:49
示例:
// if month = January
// generate items that date month is January
<table id="one">
foreach ($this->items as $i => $item) : // My foreach loop
<tr>
<td><?php echo $item->name; ?></td>
<td><?php echo $item->date; ?></td>
</tr>
endforeach;
</table>
// if month = February
// generate items that date month is February
<table id="two">
foreach ($this->items as $i => $item) : // My foreach loop
<tr>
<td><?php echo $item->name; ?></td>
<td><?php echo $item->date; ?></td>
</tr>
endforeach;
</table>