欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

codeigniter中view通過(guò)循環(huán)顯示數(shù)組數(shù)據(jù)的方法

 更新時(shí)間:2015年03月20日 12:17:08   作者:work24  
這篇文章主要介紹了codeigniter中view通過(guò)循環(huán)顯示數(shù)組數(shù)據(jù)的方法,實(shí)例分析了codeigniter中view方法與數(shù)組遍歷的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了codeigniter中view通過(guò)循環(huán)顯示數(shù)組數(shù)據(jù)的方法。分享給大家供大家參考。具體如下:

controller如下:

<?php
class SimpleController extends Controller
{
function index()
 {
  $data['my_list'] = array("do this", "clean up", "do that");
  $this->load->view('index', $data);
 }
}
?>

Index view如下:

<html>
<head>
<title>display array data</title>
</head>
<body>
<h1>Display array data</h1>
<?php
foreach($my_list as $item)
{
 echo $item;
}
?>
</body>
</html>

希望本文所述對(duì)大家基于codeigniter的php程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論