Using a variable function determined by some input variable : Dynamic Function « Functions « PHP






Using a variable function determined by some input variable

 
<?
function italian() {
     print "italian.";
}

function english() {
     print "english.";
}

$language = "italian";
$language();
?>
  
  








Related examples in the same category

1.Calling Functions Dynamically
2.Calling a Function Dynamically
3.Calling Variable Functions
4.Calling a Function Dynamically
5.Creating Dynamic Functions
6.return the function name from a function call or calculation
7.Variable function example
8.Variable Function Names
9.String Manipulation
10.Using Arrays of Lambda Functions