I could not figure out how to pass a variable number of variables into a function. I thought passing in an array and using the array keys for the variables names could replace the need to pass extra variables into the function, and it worked (I'm sure there is a better way to accomplish this, suggestions welcome). However, I can't seem to get the keys out of the array inside the function.
The array:
$parameters[day] = 1;
$parameters[month] = 8;
$parameters[year] = 2010;
Inside the function:
foreach(key($parameters) as $key)
{
print($key);
print("<br>");
}
The code inside the function retuns a warning: Invalid argument supplied for foreach(). How can I pull the keys out of the array?