Richard_SM
New Member
I need a function with variable number of arguments, to access to the elements of a multidimensional array. I have done in this way ($this->_config is the array)...\[code\]function item(){ if(func_num_args() != 0){ $config = $this->_config; $args = func_get_args(); foreach($args as $item){ $config = $config[$item]; } unset($args); return $config; } else throw new Exception('An item index is required.');}\[/code\]Is there a way to do better? Thanks to all!