php function with undefined amount of params
function sum() {
// args looks like: array(1,2,3)
$args = func_get_args();
return array_sum($args);
}
echo sum(1,2,3); // prints 6
Are there any code examples left?
New code examples in category PHP