Join Up!
104886 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previouscreate_functionfunc_get_argsnext
Last updated: Sun, 27 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Finnish | German | Spanish

func_get_arg

(PHP 4 )

func_get_arg -- Vrátit položku ze seznamu argumentů

Popis

mixed func_get_arg ( int arg_num)

Vrací argument, který je na arg_num-té pozici v seznamu argumentů užiavtelsky definované funkce. Argumenty funkcí se počítají od nuly. func_get_arg() při volání mimo definici funkce generuje varování.

Pokud je arg_num větší než počet skutečně předaných argumentů, vygeneruje varování a vrátí FALSE.

<?php
function foo() {
     $numargs = func_num_args();
     echo "Number of arguments: $numargs<br>\n";
     if ($numargs >= 2) {
     echo "Second argument is: " . func_get_arg (1) . "<br>\n";
     }
}

foo (1, 2, 3);
?>

func_get_arg() se dá použít ve spojení s func_num_args() a func_get_args() k tvorbě uživatelsky definovaných funkcí, které přijímají proměnný počet argumentů.

Poznámka: Tato funkce byla přidána v PHP 4.

User Contributed Notes
func_get_arg
add a note about notes
There are no user contributed notes for this page.
previouscreate_functionfunc_get_argsnext
Last updated: Sun, 27 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST