foreach循环的{$key}键值,为什么都是最后那一个数组的键值
传去模版的变量数组 $list = [ "user1" =>["username"=>"1","email" => "123"], "user2" =>["username"=>"2","email" => "456"], "user3" =>["username"=>"3","email" => "789"] ]; 模版的foreach {foreach $list as $k } <p>{$key}</p> {/foreach} 结果 user3:1:123 user3:2:456 user3:3:789 然后那个{$key} 循环了三次,为什么键值都是user3 而不是user1 user2 user3