$employee = [
['id'=>1, 'name'=>'关羽', 'age'=>40, 'sex'=>1, ' hiredate'=> time()],
['id'=>2, 'name'=>'张飞', 'age'=>40, 'sex'=>1, 'hiredate'=> time()],
['id'=>3, 'name'=>'赵子龙', 'age'=>50, 'sex'=>1, 'hiredate'=> time()],
['id'=>4, 'name'=>'曹总', 'age'=>45, 'sex'=>1, 'hiredate'=> time()],
['id'=>5, 'name'=>'貂蝉', 'age'=>18, 'sex'=>0, 'hiredate'=> time()],
];
<!--foreach()替代语法-->
<?php foreach($employee as $emp) : ?>
<tr>
<td><?php echo $emp['id']; ?></td>
<td>
<?php echo $emp['name']; ?>
</td>
<td>
<?php echo $emp['age']; ?>
</td>
<!--if()替代语法-->
<td>
<?php if($emp['sex'] == 1) : ?>
男
<?php else: ?>
女
<?php endif; ?>
</td>
<!--如果只是简单的输出变量可以使用php短标签语法-->
<td>
<?php
//echo date('Y/m/d',$emp['hiredate']);
?>
</td>
<td>
<button onclick="location.href='#'">增加</button>
<button onclick="location.href='#'">查询</button>
<button onclick="location.href='#'"><span style="color:red">删除</span></button>
</td>
</tr>
<?php endforeach;?>