Question may be confusing...
the php array_merge()
function takes an unlimited amount of arguments E.G.
array_merge($array1, $array2, $array3, $array4, $array5, $array6, $array7);
but what if I want to call this from within a function?
I have a merge()
function that can be overloaded, and I want to do things to the array before concatenating them!
so how is array_merge called when I've got the array arguments in an array?
EXAMPLE
public function index() {
$head = $this->_model->title("Index Page"); // returns array
$nav = $this->_model->navigation(); // returns array
$default = $this->_model->default_page(); // returns array
$data = $this->merge($head, $nav, $default); // merge all arrays
$this->loadView( 'view_admin', $data );
}
private function merge(){
$args = func_get_args();
// ... do stuff the the arrays ...
return array_merge($args[0],$args[1],$args[2]);
}
As you can see, currently in my merge function is:
return array_merge($args[0],$args[1],$args[2]);
This is hardcoded in.
How do I dynamically call the array_merge() function???
maybe something like
array_merge(/* All Array args passed in */)