& Lt; HTML & gt; & lt; HEAD & gt; & lt; TITLE & gt; Dynamic Call Function & lt; TITLE & gt; & lt; HEAD & gt; & lt; BODY & gt; & lt; FONTSIZE5 & gt; & lt ;? & Nbsp; functionwrite ($ text) & nbsp; define the functionwrite () function & nbsp ;{& nbsp; & nbsp; print (
Dynamic function call
Function write ($ text) // define the function write () function
{
Print ($ text); // print the string
}
Function writeBold ($ text) // defines the function write () function
{
Print ("$ Text"); // Print the string
}
$ MyFunction = "write"; // define the variable
$ MyFunction ("Hello!
"); // Because the variable is enclosed in parentheses, find the function with the same name.
Print ("
\ N ");
$ MyFunction = "writeBold"; // defines the variable
$ MyFunction ("Goodbye! "); // Because the variable is enclosed in parentheses, find the function with the same name.
Print ("
\ N ");
?>