Calling a Function Dynamically : Dynamic Function « Functions « PHP






Calling a Function Dynamically

 
<html>
<head>
<title>Calling a Function Dynamically</title>
</head>
<body>
<div>
<?php
    function sayHello() {
      print "hello<br />";
    }
    $function_holder = "sayHello";
    $function_holder();
?>
</div>
</body>
</html>
  
  








Related examples in the same category

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