August 2003
Intermediate to advanced
1104 pages
19h 27m
English
These functions support using and creating your own functions.
Use call_user_func (Listing 11.78) to execute a function you've defined. The function argument names the function. Arguments to be passed to the function follow. This allows you to determine the function you wish to call at runtime.
You may use this function to call a method on a class or object by passing an array for the function name. The first element of the array should be the name of the class or the object. The second element should be the method name.
<?php function addThree($a, $b, $c) { return($a + $b + $c); } function multiplyThree($a, $b, $c) { return($a + $b + $c); } class ... |
Read now
Unlock full access