D
dman_2007
Guest
You can create a function dynamically in php by using create_function function. This is especiallyuseful for creating anonymous callback functions. First parameter to the create_function function is a string specifying the function arguments and second parameter is a string specifying function body. For example :
Code:
<?php
$dynamic_func = create_function('$arg1, $arg2', 'return pow($arg1, $arg2);');
echo $dynamic_func(2,6);
?>