func_get_args()
Use this to get an array containing all of the arguments passed to the function.
This is handy for functions which take an unlimited number of arguments. Some of PHP’s functions that work that way include array_merge() and var_dump(). You can pass in any number of arguments to those functions.
If you’re writing functions which do the same, func_get_args() will give you a single array containing all the arguments passed in.
function myFunc( $x, $y = 'hi', $z = null ) { return func_get_args(); } $a = myFunc( 'this', 'that', 'other' ); /* array ( 0 => 'this', 1 => 'that', 2 => 'other' ) */ $b = myFunc( 'this', 'that' ); /* array ( 0 => 'this', 1 => 'that' ) */ $c = myFunc( 'this' ); /* array ( 0 => 'this' ) */
See the manual entry for func_get_args()
