Assumed that $old_array is an array.

{def $new_array = array()}
{
foreach $old_array as $key=>$model}
{set
$new_array = $new_array|append($model)}
{
/foreach}
Pay attention to the code: {set $new_array = $new_array|append($model)}, we have to use "set" to add the value to the array!

So wired!

相关文章: