This article mainly introduces the method of displaying array data through the view loop in codeigniter. The example analyzes the view method and array traversal techniques in codeigniter, which has some reference value. If you need it, you can refer to it.
This article mainly introduces the method of displaying array data through the view loop in codeigniter. The example analyzes the view method and array traversal techniques in codeigniter, which has some reference value. If you need it, you can refer to it.
This example describes how to display array data cyclically in the view of codeigniter. Share it with you for your reference. The details are as follows:
The controller is as follows:
<? Phpclass SimpleController extends Controller {function index () {$ data ['my _ list'] = array ("do this", "clean up", "do that "); $ this-> load-> view ('index', $ data) ;}}?>
The Index view is as follows:
Display array dataDisplay array data <? Phpforeach ($ my_list as $ item) {echo $ item;}?>
I hope this article will help you with codeigniter-based php programming.
,