func_get_args使用的实例
function f_test1($i)
{
echo "this function have one param";
}
function f_test2($i,$j)
{
echo "this function have two param";
}
function f_test3($i,$j,$m)
{
echo "this function have three param";
}
function f_test()
{
$args = func_get_args();
$nums = func_num_args();
call_user_func_array('f_test'.$nums, $args);
}
f_test(4,5,6);//输出 this function have three param
本文介绍如何利用PHP内置函数func_get_args实现动态代理调用多个参数的功能,通过实例展示了其使用方法及输出结果。
324





