$scripts[0] = 'Say Hello';
$scripts[1] = 'Dont Say Hello';
$scripts[2] = 'Welcome';
$function_name = str_replace(' ', '_', $scripts[0]); //Name of the function "Say_Hello"
echo $function_name('Jolly'); // Should echo "Hello Jolly"
I have a huge array with full of names which are associated with functions. In normal ways, if we are to call the function Say_Hello(), we do like this : Say_Hello('Jolly'). But in my case above, the name of the function is stored in a variable so how can I call it?
Thanks