如何从存储在变量中的字符串调用函数?
问题描述:
我需要能够调用一个函数,但是函数名称存储在变量中,这可能吗?例如:
I need to be able to call a function, but the function name is stored in a variable, is this possible? e.g:
function foo ()
{
//code here
}
function bar ()
{
//code here
}
$functionName = "foo";
// i need to call the function based on what is $functionName