This article analyzes thinkPHP's simple array traversal method through examples. Share it with everyone for your reference, the details are as follows:
has the following array:
array( array( 'id'=>1, 'username'=>'mgckid', 'sex'=>1 ) array( 'id'=>2, 'username'=>'yezi', 'sex'=>0 ) )
thinkphp template tag writing method:
<volist name='data' id='vo'> <{$vo.id}>---------<{$vo.username}>-----------<{$vo.sex}><br/> </volist>
Traversal results:
1---------mgckid-----------1 2---------yezi-----------0
Attached is a comparison of how to write the Dreamweaver tag to enhance understanding:
{dede:arclist typeid='20' row='5' titlelen='40'} [field:title/] [field:arcurl/] [field:pubdate/] [field:infos/] [field:writer/] {/dede:arclist}
Supplement: The editor here recommends a PHP formatting and beautifying typesetting tool on this website to help you code typesetting in future PHP programming:
PHP code online formatting and beautification tool: http://tools.jb51.net/code/phpformat
Readers who are interested in more thinkPHP-related content can check out the special topics on this site: "ThinkPHP Getting Started Tutorial", "ThinkPHP Common Methods Summary", "Smarty Template Basic Tutorial" and "PHP Template Technology Summary".
I hope this article will be helpful to everyone’s PHP programming based on the ThinkPHP framework.