Join Up!
96812 members and counting!

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

func_num_args

(PHP 4 )

func_num_args -- Devuelve el número de argumentos pasados a la función.

Descripción

int func_num_args ( void )

Devuelve el número de argumentos pasados a la función actual definida por el usuario. func_num_args() generará un aviso si es llamada desde fuera de la definición de la función.

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

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

func_num_args() puede utilizarse conjuntamente con func_get_arg() y func_get_args() para permitir a las funciones definidas por el usuario que acepten listas de argumentos de longitud variable.

Nota: Esta función fue añadida en PHP 4.

User Contributed Notes
func_num_args
add a note about notes
There are no user contributed notes for this page.
previousfunc_get_argsfunction_existsnext
Last updated: Tue, 29 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