Hi
I am trying to write a function that will take quite a few parameters.
I am currently defaulting them to NULL in the function declaration, but i want to be able to call the function with some but not all the parameters.
I have tried to use func_get_args(), but this is no good as i dont know which parameters were passed, only their values.
Is there a way that i can declare a function like...
I am trying to write a function that will take quite a few parameters.
I am currently defaulting them to NULL in the function declaration, but i want to be able to call the function with some but not all the parameters.
I have tried to use func_get_args(), but this is no good as i dont know which parameters were passed, only their values.
Is there a way that i can declare a function like...
Code:
function newStar($title=null,$date=null,$name=null,$message=null,$donation=null, $currency=null, $language=null,$type=null, $x=null, $y=null, $z=null, $friends=array()){
// my function internals
}
What i am trying to do is call it like this...
newStar($title,$name,$message,$friends);
if i do newStar($title, ,$name,$message, , , , , , ,$friends);
than i get errors...
any suggestions would be great, thanks.