I have a function defined as:
function foo($params)
{
echo "Hello ".$params;
}
Then, in another file, I have:
$functionName = "foo";
$functionParams = "World";
include("./path_to_file_where_above_function_exists.php");
$functionName($functionParams);
This outputs, as expected:
Hello World
So far so good, what I want to know is how can I check if the function exists in the other file? For example, if I change:
$functionName = "foo";
to
$functionName = "bla";
The code throws no errors. Any help on how to properly handle errors in this case?
Thank you.