I’m trying to check whether a function exists or not but I keep getting false in my if
I try to call the function like this, where $function is the function name:
if (function_exists($this->module->$function))
{
$this->module->$function($vars);
}
else
{
echo 'no';
}
The variable module is defined as the class where the function should be called:
$this->module = $module;
$this->module = new $this -> module;
Am I missing something here?
Thank you!
Just could figure it out:
Using method_exists() solved my problem
I answered this question on my own for people who may have the same problem!