Function overloading

Shows how to "overload" functions
function Test(){ $NumberOfArguments = func_num_args(); for ($x=0; $x < $NumberOfArguments; $x++){ $Argument = func_get_arg($x); print $Argument . "\n"; } // Another way: print_r(func_get_args()); } //Example: Test('hello','world','foobar'); /* returns: hello world foobar */

Url: http://www.jonasjohn.de/snippets/php/function-overloading.htm

Language: PHP | User: ShareMySnippets | Created: Oct 16, 2013