Well, I don’t know about you - but sometimes I get a bit frustrated with people attempting to send too much, or too little information to my class functions, so I began to implement variable free function calls. It gives a little bit of flexbility in how you can use it (which I won’t go too much into) and might not suit all users requirements. However, the simple call you want to run is this:
function Myfunction() {
$Arguments = func_get_args();
}
This will give you an array (if there are arguments) containing all of the variables sent to the function. The best way to deal with the arguments, is to do what you would normally do and assume that your function is setup like: function($Var1,$Var2) etc. Why would this be helpful then? Well, it allows you to write functions like this:
function MyFunction() {
$Arguments = func_get_args();
foreach($Arguments as $Argument) {
$Result[] = mysql_query($Argument);}
}
Just a little handy tip.