How do I write a function that can accept unlimited number of parameters?
What am trying to do is create a function within a class that wraps the following:
Previously you should have used func_get_args()
, but in the php 5.6, you can use ... operator.
So for example you can write the function which returns you a sum of all the numbers, sent to the function:
function bind_param(...$params){
var_dump($params);
}
Your params
is actually an array of all elements.