Jump to content

Archived

This topic is now archived and is closed to further replies.

bcoffin

recursive assign?

Recommended Posts

Does anybody know a good script to recursively process/assign smarty variables?
This is what I'd like to do...

foreach($vals as $k=>$v) {
  if(is_array($v))
  {
    foreach($v as $ak=>$av)
    {
        $this->smarty->assign(array($k[$ak] => strtoupper($av)));
    }
  }
  else
  {
      $this->smarty->assign(array($k => strtoupper($v)));
  }
}

..however, I would like it to process all levels of an array, no matter how deep... ideas?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.