I have two functions, one which parses all the arguments sent to the function and another that actually does something with that information.
So function1()
can take in any number of parameters and then uses func_get_args()
to get them all and process them to come up with a string. However, I have a function2()
which I want to have a similar function but some extra stuff added after that. Basically, the second function will save a piece of information that would be overwritten by the first to a temporary variable, then execute the first function, and continue with the rest of that function. So how can I send all the parameters that are sent in to function2()
to function1()
when it's called within the second function? I feel like I might be over-thinking this and there will probably be a simpler way to do it.
EDIT
I call this function:
function2("arg1", "arg2", "arg3");
and inside that function, I need to send those arguments to function1, like so:
function2() {
$old = $this->name;
function1("arg1", "arg2", "arg3");
}
and function1 will do it's processing so function2 can continue. The first function changes the name variable in the class, so I need to temporarily store it beforehand (I don't need it anymore after the function completes). So basically we're just taking the arguments sent to function2 and plugging them into function1.