func_get_arg — 返回参数列表的某一项
func_get_args — 返回一个包含函数参数列表的数组
func_num_args — 返回传递给函数的参数个数
call_user_func — 把第一个参数作为回调函数调用
call_user_func_array —调用回调函数,并把一个数组参数作为回调函数的参数
forward_static_call_array — Call a static method and pass the arguments as array
forward_static_call — 调用静态方法并将参数作为数组传递
=========================================
一、
func_get_arg、func_get_arg、func_num_args class test{ public function hello($a,$b,$c,$d){ $num=func_num_args(); echo "方法参数的个数为:".$num," "; if(2<=$num){ echo "方法的第三个参数为:".func_get_arg(2)." "; } $num2=func_get_args(); for($i=0;$i<$num;$i++){ echo "第{$i}个参数为{$num2[$i]}"." "; } } } $T=new test(); $T->hello('A','B','C','D'); //方法参数的个数为:4 //方法的第三个参数为:C //第0个参数为A //第1个参数为B //第2个参数为C //第3个参数为D
本篇将讲解php常用函数处理的函数解析,更多相关内容请关注php中文网。
相关推荐:
以上就是php常用函数处理的函数解析的详细内容,更多请关注php中文网其它相关文章!
![php中文网最新课程二维码](/static/images/article_wechat2021.jpg?1111)
声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论