php function with undefined amount of params code example
Example: 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