<?php
// Create function with the name defined in variable $functionName
function MyFunction($argument) {
return 'Argument passed is: '.$argument;
}
$functionName = 'MyFunction';
var_dump(MyFunction('Calling MyFunction directly.'));
var_dump($functionName('Calling MyFunction with string.'));