Forum Moderators: coopster
function photo_getpid($file, $album, $oid, $x, $y){
//some code to find out what's used and to set the query
return $ret_var;
};
I've seen some things where & was put in front of a argument and where arguments where given a value like you do with variables. I still can't find out what's needed to make arguments optional..
Here are a few helpful pages from php.net:
Function arguments [php.net]
func_get_args() [php.net], for variable length argument lists
References [php.net], which is what you were talking about when mentioning the ampersand.
I'd look at all three, though, as they provide different flexibility depending on usage and needs.
function photo_getpid($file='', $album='', $oid='', $x='', $y='')
In this case each variable has been assigned, so just using:
photo_getpid();
will be ok with no errors.
So, assign the variables, then check in the function if any have values.
dc
My problem is solved, Thanks