tags:

views:

25

answers:

1

Hi,

in smarty i have this array:

{$user}
Array (3)
0 => Array (2)
  id => "1"
  name => "Peter"
1 => Array (2)
  id => "2"
  name => "Joy"
2 => Array (2)
  id => "3"
  name => "Sandra"

How i can update this array(with php)? Insert new element, age:

Array (3)
0 => Array (2)
  id => "1"
  name => "Peter"
  age => "16"
1 => Array (2)
  id => "2"
  name => "Joy"
  age => "17"
2 => Array (2)
  id => "3"
  name => "Sandra"
  age => "20"
A: 

I would define the array in PHP. And then use $smarty->assign() to publish it to the smarty template.

JochenJung