php中func_get_args 用于返回指定函数的参数数量
内容摘要
这篇文章主要为大家详细介绍了php中func_get_args 用于返回指定函数的参数数量,具有一定的参考价值,可以用来参考一下。
对func_get_args php中用于返回指定函数的参数数量的
对func_get_args php中用于返回指定函数的参数数量的
文章正文
这篇文章主要为大家详细介绍了php中func_get_args 用于返回指定函数的参数数量,具有一定的参考价值,可以用来参考一下。
对func_get_args php中用于返回指定函数的参数数量的函数对此感兴趣的朋友,看看idc笔记做的技术笔记!func_get_args php中用于返回指定函数的参数数量的函数,如果你想得到某个函数的参数个数的话,这个一定能帮到你。1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <code class = "php" > /** * func_get_args php中用于返回指定函数的参数数量的函数 * * @param * @arrange 512-笔记网: 512PiC.com **/ <?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); ?> /*** 来自php教程(www.idcnote.com) ***/ </code> |
1 2 3 4 5 6 7 8 9 10 11 12 13 | <code class = "php" > /** * func_get_args php中用于返回指定函数的参数数量的函数 * * @param * @arrange 512-笔记网: 512PiC.com **/ Number of arguments: 3<br /> Second argument is: 2<br /> Argument 0 is: 1<br /> Argument 1 is: 2<br /> Argument 2 is: 3<br /> /*** 来自php教程(www.idcnote.com) ***/ </code> |
注:关于php中func_get_args 用于返回指定函数的参数数量的内容就先介绍到这里,更多相关文章的可以留意
代码注释