
php foreach为什么运行后是这个样子的,哪里错了?
前段页面代码:<tableclass="tabletable-borderedresponsive"><thead><tr><th>排名</th><th>经济人姓名</t...
前段页面代码:
<table class="table table-bordered responsive">
<thead>
<tr>
<th>排名</th>
<th>经济人姓名</th>
</tr>
</thead>
<tbody>
{foreach $res_list as $k=>$v }
<tr>
<td>{$v.id}</td>
<td>{$v.name}</td>
</tr>
{/foreach}
</tbody>
</table>
后台代码:
public function prorank(){
$user = M("property")->find();
$this->assign('user',$user);
$this->display();
} 展开
<table class="table table-bordered responsive">
<thead>
<tr>
<th>排名</th>
<th>经济人姓名</th>
</tr>
</thead>
<tbody>
{foreach $res_list as $k=>$v }
<tr>
<td>{$v.id}</td>
<td>{$v.name}</td>
</tr>
{/foreach}
</tbody>
</table>
后台代码:
public function prorank(){
$user = M("property")->find();
$this->assign('user',$user);
$this->display();
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询