函数名: func_num_args()
适用版本: PHP 4, PHP 5, PHP 7
用法: func_num_args() 函数用于获取当前函数或方法传递的参数个数。
示例:
function testFunc($arg1, $arg2) {
$numArgs = func_num_args();
echo "传递的参数个数为: " . $numArgs . "\n";
}
testFunc(10, "Hello");
输出: 传递的参数个数为: 2
说明: