In php how would you create a function that could take an unlimited number of parameters: myFunc($p1, $p2, $p3, $p4, $p5...);
myFunc($p1, $p2, $p3, $p4, $p5...);
My next question is: how w
Previously you should have used func_get_args(), but in a new php 5.6 (currently in beta), you can use ... operator instead of using .
func_get_args()
... operator
So for example you can write :
function myFunc(...$el){ var_dump($el); }
and $el will have all the elements you will pass.
$el