急!!!php语言 请问用php如何才能输出以下表格式的结果...
发布网友
发布时间:2023-11-19 20:03
我来回答
共2个回答
热心网友
时间:2024-03-30 10:47
<?php
$data=array(
array('nickname'=>'torachan','fullname'=>'Masayuki Torai','age'=>'34','sex'=>'male'),
array('nickname'=>'takochan','fullname'=>'Takoshi Yotsuashi','age'=>'33','sex'=>'male'),
array('nickname'=>'tamochan','fullname'=>'Yuji Tamoyama','age'=>'33','sex'=>'male'),
array('nickname'=>'izumin','fullname'=>'Takato Izumikawa','age'=>'32','sex'=>'male'),
array('nickname'=>'momocchi','fullname'=>'Yuichi Ogawa','age'=>'29','sex'=>'male'),
);
?>
<table>
<thead>
<tr>
<th>昵称</th><th>姓名</th><th>年齢</th><th>性别</th>
</tr>
</thead>
<tbody>
<?php foreach($data as $row):?>
<tr>
<td><?php echo $row['nickname'];?></td><td><?php echo $row['fullname'];?></td><td><?php echo $row['age'];?></td><td><?php echo $row['sex'];?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
Today is <?php echo date('l');?><br />
<?php $w=date('N');?>
<?php if($w <7):?>
It's <?php echo 7-$w;?> days before due.
<?php else:?>
It's deadline!!
<?php endif;?>
热心网友
时间:2024-03-30 10:47
表格,这是HTML啊