Hello,
I have a problem passing an undefined number of arguments to a function.
The problem is that the function belongs to a class and itself has to pass this number of arguments to a function in another class.
The function of the second class gets the arguments using func_get_args().
The first function gets the arguments as an array or string, can't think of a better way. The content of the array now has to be transformed into a set of arguments to be passed to the other function, and this is the problem.
Does anybody have an idea?
Little code:
script one (main script):
$firstcall = new futils;
$res = $firstcall->func_a($in); //$in = array or string
script with class futils:
function func_a($in) {
//Transformation should be here
$out = $this->lastclass->func_b() //should pass the undefined number of arguments
//lastclass instance is defined in a function at
//the beginning of the class
return $out;
}
Well, func_b() now processes the arguments
Tried a lot already, eval(), implode(), etc, but func_a() only passes an array or a string as one single argument.
Thanks in advance.
Best regards
gaucho