My project has a function that generates a registration form, and has parameters so that it can set the default values for the various input fields.
Rather than entering a long list of parameters each time I call the function, I would like to simply call upon an array that will enter all of them. At the same time, I would like for the function itself to still specifically define each variable of the incoming array.
Example:
function regform ($username, $password, $occupation)
{
...
}
$defaultvalues = array();
$defaultvalues['1'] = "";
$defaultvalues['2'] = "";
$defaultvalues['3'] = "";
regform(???);
When regform is used, I would like to enter the name of the array, rather than call each member of the array individually. Can this be done, or is it necessary to reference all records within the array?