嗨,我有这个代码和数组:
<?php
$arr = array(
0 => array('first_name' => 'Ace', 'last_name' => 'Jones'),
1 => array('first_name' => 'Aron', 'last_name' => 'Jones'),
2 => array('first_name' => 'Ben', 'last_name' => 'Jones'),
3 => array('first_name' => 'Billy', 'last_name' => 'Jones'),
4 => array('first_name' => 'Barney', 'last_name' => 'Jones'),
5 => array('first_name' => 'Con', 'last_name' => 'Jones'),
6 => array('first_name' => 'Dan', 'last_name' => 'Jones'),
7 => array('first_name' => 'Earl', 'last_name' => 'Jones'),
8 => array('first_name' => 'East', 'last_name' => 'Jones'),
9 => array('first_name' => 'Fez', 'last_name' => 'Jones')
);
$html = '';
foreach($arr as $k => $v) {
echo $v['first_name'] . '<br />';
}
?>
<table rules="all" style="border:1px solid blue;" cellspacing="2" cellpadding="2">
<tr>
<td>Label</td>
<td>First Name</td>
<td>Last Name</td>
</tr>
<?php echo $html; ?>
</table>
我怎样才能只显示名字的每个字母的标签?下面是我想要完成的结果。
谢谢。