Archive - Feb 16, 2007

Date

Finally, dynamically call classes and methods!

in

Introduction:
Dynamically call functions and methods can be used on making plugin systems where you send the same kind of data to a unknown function.

How to...
I suppose everyone knows how to dynamically call an function.
Suppose there are times you don't know what function you will call, you might want to express it into an array full of function names, and then use variable function system.

//This will be defined by a plugin writer
$rand_func[] = 'rand';
$rand_func[] = 'mt_rand';
$key = array_rand($rand_func);
Honey Pot that kill bots