I'm stuck! I am calling a class, and a method within it dynamically. Normally this would be straight forward, however I also need to pass some arguments to the method, this is what stumps me.
Say for example I did:
Code: Select all
$args = array(
'1' => 'var1',
'2' => 'var2'
);
$obj = new $class;
$obj->$method($args);Code: Select all
method($arg1, $arg2){
return true;
}Am I missing something obvious? I've read up on reflection, but to be honest, it's confused the hell out of me
Thanks!