I am currently using CodeIgniter.
I am trying to write a function that can take an unlimited number of paramaters.
So in the controller it will be something like
function test($name, $others){
    foreach($others){
       //do something
    }
}
and I could call it like
example.com/control/test/some name/param1/param2/param3/param4/param5... 
How can I set this up?
you could also do it like this:
function foo($params=array())
{
    $params=func_get_args();
    //print_r($params);
}
so any url like:
site.com/controller/foo/param1/param2/param3/param4
would create an array of parameters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With