Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Calling Functions Dynamically

Tue Oct 28, 2008 1:39 pm

Code:
<!--
   In PHP, you can call functions dynamically

   1.   Declare a function
   2.   Then declare a variable and assign the function name to the variable (as a string)
   3.   Then use the variable as a function
-->

<?php
  
function addition ($a, $b){
      echo (
$a + $b), "\n";
  }
  
$result = "addition";
  
$result (3,6);
?>




Post a reply
  Related Posts  to : Calling Functions Dynamically
 Calling the man Command     -  
 Calling an Overridden Function     -  
 Calling other programs from java     -  
 Calling an Overridden Method in php     -  
 Calling a Private Method in jsp     -  
 Calling Overloaded Methods     -  
 What are Inline functions?     -  
 What are Virtual Functions?     -  
 Functions and References     -  
 PHP Array Functions     -  

Topic Tags

PHP Functions