/ Published in: PHP

allows for variable length arguments - something similar as python
func(*args, **kw)
func(*args, **kw)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function foo() { if ($numargs >= 2) { } for ($i = 0; $i < $numargs; $i++) { echo "Argument $i is: " . $arg_list[$i] . "<br />\n"; } } foo(1, 2, 3); foo(1, 2, 3, 4, 5);
Comments
