★ wanayoo — archive 1999 http://fr.php.net/manual/function.func-get-args.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Functions
Quick Reference
English version of this pageGerman version of this pageJapanese version of this page
Italian version of this pageFrench version of this pageHungarian version of this page
Spanish version of this pageDutch version of this pageBrazilian Portuguese version of this page
Korean version of this pageCzech version of this page
Functions
* call_user_func
* create_function
* func_get_arg
* func_get_args
* func_num_args
* function_exists
* register_shutdown_function

  Thanks to:
 Chek.com
 easyDNS
 VA Linux Systems

  Related sites:
Apache
MySQL
PostgreSQL
Zend Tech.

  Community:
LinuxFund.org
OSDN
Manual: func_get_args
View the source code for this pageSearch the site



Previous page
 func_get_arg
 Updated
Mon, 08 Jan 2001
func_num_args 
Next page


func_get_args

(PHP 4 >= 4.0b4)

func_get_args --  Returns an array comprising a function's argument list

Description

array func_get_args (void )

Returns an array in which each element is the corresponding member of the current user-defined function's argument list. Func_get_args() will generate a warning if called from outside of a function definition.


<?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";
    }
    $arg_list = func_get_args();
    for ($i = 0; $i < $numargs; $i++) {
    echo "Argument $i is: " . $arg_list[$i] . "<br>\n";
    }
} 

foo (1, 2, 3);
?>
      

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

Note: This function was added in PHP 4.


 About Notes


Previous page
 func_get_arg
 Updated
Mon, 08 Jan 2001
func_num_args 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
France
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.