[eluser]PeteSig[/eluser]
From the tutorials / examples / user guide, if you're only going to pass a single param you do:
Code:
// set default NULL value to $in so we don't crash & burn
// if func called without a param!
// Not strictly required, but I read somewhere in the forum that its desirable!
function doSomething($in = NULL)
{
if(NULL != $in)
{
// do something....
}
else
{
//nothing passed in so....
}
}
But if I were to pass more than 1 or more params would I do:
Code:
function doSomething($in = NULL)
{
if(NULL != $in)
{
$params = $this->uri->segment_array();
foreach($params as $p)
{
// do something with $p ....
}
}
else
{
//nothing passed in so ....
}
}
Is this correct / prefered method?
Cheers
Pete