When you want to write a function that can use any number of parameters/arguments there are 2 ways.
The first uses defaults and appears as if you are using a variable number of arguments. You have to know the maximum number of parameters/arguments, and for each one you must specify a default. This is shown below in the function href1().
The second is the actual way to get a variable number of parameters/arguments from the function. You use func_num_args() which is the number of arguments, and func_get_arg($i) to fetch each argument (where $i is the argument number).
In each of the function calls above to href1() and href2(), they all produce the same results: