亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

foreach,foreachelse function

foreach, foreachelse function

Usage:

foreach is used to process simple arrays ( The elements in the array are of the same type), and its format is much simpler than section. The disadvantage is that it can only handle simple arrays.
foreach must be used in pairs with /foreach and must be specified from and item attributes.
name Attributes can be specified arbitrarily (a combination of letters, numbers and underscores).
foreach can be nested, but the name of the foreach in the nest must be unique.
The from attribute (usually an array) determines the number of loops.
foreachelse statement in from It is executed when the variable has no value.

test.php:

$smarty->assign('custid', array(1000 ,1001,1002));

test.html:

##{foreach from=$custid item=curr_id}id: {$curr_id}<br>
{/foreach}

Output:

微信圖片_20180313094534.png


Continuing Learning
||
<?php echo "foreach,foreachelse函數(shù)";
submitReset Code