Home > Backend Development > PHP Tutorial > The difference between func_get_args(), func_get_arg(), and func_num_args() in PHP_PHP Tutorial

The difference between func_get_args(), func_get_arg(), and func_num_args() in PHP_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 16:13:24
Original
903 people have browsed it

Copy code The code is as follows:

function jb51(){ ());
echo "
";
echo func_get_arg(1);
echo "
";
echo func_num_args();
}

jb51("www","jb51","net");
?>

Output result:

Array ( [0] => blog [1] => micxp [2] => com )

micxp
3

We can see from the above results

func_get_args() This function returns an array containing all the parameters of the current function

func_get_arg() The function returns the value of the parameter at the specified position
func_num_args() This function returns the parameters of the current function The quantity returned is a number

http://www.bkjia.com/PHPjc/313503.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/313503.htmlTechArticleCopy the code as follows: ?php function jb51(){ print_r(func_get_args()); echo "br"; echo func_get_arg(1); echo "br"; echo func_num_args(); } jb51("www","jb51","net"); ? Output results...
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template