$arr = Array ([0]=>array ([goods_id]=>1[goods_name]=> phone [goods_price33]=>1000)] [1]=>array ([goods_id]= >2[goods_name]=> computer) [goods_price33]=>2000]);
$smarty->assign (' goods_list ', $arr);
?>
{foreach from= $goods _list item=goods}
{$goods. goods_id}
{$goods. Goods_name}
{$goods. goods_price33} normal display price 1000
{/foreach}
The 33 in question Goods_price33 is a variable that shows different values depending on the member ID
How to implement the changes in the template, try a lot of methods are not
Like what
$num =$_get[' id ']
$smarty->assign (num, $num);
{foreach from= $goods _list item=goods}
{$goods. goods_id}
{$goods. Goods_name}
{$goods. goods_price{$num}} is not normal, the browser displays {$goods. goods_price33}, the price cannot be displayed
{/foreach}
Reply to discussion (solution)
$num =$_get[' id ']
$smarty->assign (num, $num); You're here to judge that the user ID is not better
Logical things don't put them in the content.
$num =$_get[' id ']
$smarty->assign (num, $num); You're here to judge that the user ID is not better
This paragraph is in the PHP script file, but the assignment to the template loop will not work, other places normal
Logical things don't put them in the content.
is not put on the content, maybe I did not say clearly, that is separate, in PHP after assignment, the reference to the template loop does not show the value, other places can be displayed
You should get the ID of the member in PHP to display in the array, and then assign the value to the template, not directly assigned to the template.