PHP: func_num_args - Manual in Deutsh
PHP: func_num_args - Manual in French
PHP: func_num_args - Manual in Polish

You Are At PHP: func_num_args - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

func_num_args

(PHP 4, PHP 5)

func_num_args -- Returns the number of arguments passed to the function

Description

int func_num_args ( void )

Gets the number of arguments passed to the function.

This function may be used in conjunction with func_get_arg() and func_get_args() to allow user-defined functions to accept variable-length argument lists.

Return Values

Returns the number of arguments passed into the current user-defined function.

Errors/Exceptions

Generates a warning if called from outside of a user-defined function.

Examples

Example 1. func_num_args() example

<?php
function foo()
{
    
$numargs = func_num_args();
    echo
"Number of arguments: $numargs\n";
}

foo(1, 2, 3);    // Prints 'Number of arguments: 3'
?>

Notes

Note: Because this function depends on the current scope to determine parameter details, it cannot be used as a function parameter. If you must pass this value, assign the results to a variable, and pass the variable.

See Also

func_get_arg()
func_get_args()

Najlepsza ochrona mienia na rynku
tłumaczenia
opakowania z nadrukiem
Najlepsza organizacja eventów Gorąco Polecamy!
Strony internetowe

Another Useful functions:


function.parsekit-func-arginfo | function.func-num-args | function.func-get-args | function.func-get-arg | function.call-user-func-array |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.