Is there a way to pass an unlimited amount of arguments to a function, and access all of those arguments without needing to define each one in the heading. Here is an example to make it more clear:
function doSomething($var1="", $var2="".........)
{
// Do something with the arguments
}
I don't want to have to go define a bunch of arguments. Is there a way to just grab all the arguments in an array? Even if they haven't been defined? (PHP BTW)
The end result should look something like this:
func("hello", "ya", "hi", "blah", "test", "go");
function func()
{
//Loop Over Arguments
}
I've seen some native PHP functions be able to accept a seemingly infinite number of arguments, but can user-defined functions do the same?