以下是我在Foreach LOOP中的列表:
FTX161983S0-XX
FTX161983S0-X
FTX161983S0
这是我的代码;
<?php foreach ($serial_items as $k => $v): ?>
<?php foreach ($v['children'] as $a => $b): ?>
<li>
<a href="<?=site_url("contracts/serial/".$c->id.'/'.$this->uri->segment(4).'/'.$b->id."#".$b->serial_num);?>">
<span class="badge badge-important" style="font-size:12px;"><?=$b->serial_num?></span>
</a>
</li>
<?php endforeach; ?>
<?php endforeach; ?>
如果我点击FTX161983S0-XX我想得到最后两个FTX161983S0-X和FTX161983S0
如果我点击FTX161983S0-X我想要获得FTX161983S0
问:我怎么能循环呢?