Jump to content

recursive assign?


bcoffin

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?
Link to comment
https://forums.phpfreaks.com/topic/19059-recursive-assign/
Share on other sites

Archived

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

×
×
  • Create New...

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.