PHP中func_get_args(),func_get_arg(),func_num_args()的区别_php教程-查字典教程网
PHP中func_get_args(),func_get_arg(),func_num_args()的区别
PHP中func_get_args(),func_get_arg(),func_num_args()的区别
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:输出结果:Array([0]=>blog[1]=>micxp[2]=>com)micxp3从上面的结果中我们就可以看出fu...

复制代码 代码如下:

<?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");

?>

输出结果:

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

micxp

3

从上面的结果中我们就可以看出

func_get_args() 这个函数返回的是包含当前函数所有参数的一个数组

func_get_arg() 函数返回的是指定位置的参数的值

func_num_args() 这个函数返回的是当前函数的参数数量 返回的是数字

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新php教程学习
    热门php教程学习
    编程开发子分类