手机
当前位置:查字典教程网 >编程开发 >php教程 >codeigniter中view通过循环显示数组数据的方法
codeigniter中view通过循环显示数组数据的方法
摘要:本文实例讲述了codeigniter中view通过循环显示数组数据的方法。分享给大家供大家参考。具体如下:controller如下:load...

本文实例讲述了codeigniter中view通过循环显示数组数据的方法。分享给大家供大家参考。具体如下:

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>

希望本文所述对大家基于codeigniter的php程序设计有所帮助。

【codeigniter中view通过循环显示数组数据的方法】相关文章:

PHP ajax 异步执行不等待执行结果的处理方法

php对象和数组相互转换的方法

Yii实现自动加载类地图的方法

PHP中显示格式化的用户输入

4.与数据库的连接

php删除指定目录的方法

php替换字符串中间字符为省略号的方法

CodeIgniter针对lighttpd服务器URL重写的方法

PHP遍历数组的方法汇总

php中smarty实现多模版网站的方法

精品推荐
分类导航