I am trying to pass array to a method and I want the method use array's values as arguments.
I posted a similar question on How to assign arrays to functions arguments? thread but I am actually working on the class method here.
if (method_exists($testInstance, $method)){
$a=array {'1'=>'aru1', '2'=>'arg2'} //could have more than 2. it's dynamic
call_user_func_array($testInstance->$method(), $a); //this won't work.
}
Any thoughts? Thank a lot!