Menu Home

func_get_args

osbo.com | PHP | Functions | func_get_args

Returns an array comprising a function's argument list

Syntax

func_get_args ( void ) : array

Return

Returns an array in which each element is a copy of the corresponding member of the current user-defined function's argument list.

Examples

<?

function myfunction() {
    $return = func_get_args();

    for ($i = 0; $i < func_num_args(); ++$i) {
        echo "$i:$return[$i]\n";
    }
}

myfunction("a", "b", "c");

?>
0:a
1:b
2:c

PHP