时间:2021-07-01 10:21:17 帮助过:24人阅读
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常用函数处理的函数解析,更多相关内容请关注Gxl网。
相关推荐:
PHP 最简单的验证登录用户(基本表单用户验证)实现办法
PHP开发中,定时执行如何判断之前的脚本是否跑完?
php中const与static的区别与使用详解
以上就是php常用函数处理的函数解析的详细内容,更多请关注Gxl网其它相关文章!