by prettyscripts on 2008-10-29 11:26:00
to define a function that takes any number of parameters, eg
PHP:
foo(); // no parameter | |
foo("a"); // 1 parameter | |
foo("a", "b", "c"); // more than 1 parameters |
to access the parameters passed to a function, use these php functions:
PHP:
function foo() { | |
foreach (func_get_args() as $i => $arg) { | |
echo "$i:" . $arg; | |
} | |
} |