Method of Smarty Area loop in PHP, Phpsmarty area loop
The example in this paper describes the method of Smarty area loop in PHP. Share to everyone for your reference. The implementation method is as follows:
Smarty Test
{foreach Key=key1 item=item1 from= $array 1}
{$key 1} |
{$item 1} |
{/foreach}
Another way:
Smarty Test
<>< td="">
<>
{Section name=section1 loop= $array 1}
{$array 1[section1]} |
{/section}
<?php require ' libs/smarty.class.php '; Contains the Smarty class library file $smarty = new Smarty; Create a new Smarty object $array 1 = Array (0 = "Simon", 1 = "Elaine", 2 = "Susan"); Defines the array $smarty->assign ("Array1", $array 1); Assign values to variables in the template $smarty->display (' test10.htm '); Show Page?>
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/1015432.html www.bkjia.com true http://www.bkjia.com/PHPjc/1015432.html techarticle The method of Smarty area loop in PHP, Phpsmarty area Loop This paper describes the method of Smarty area loop in PHP. Share to everyone for your reference. The implementation method is as follows: HTML ...