# JS Call function method for passing variable parameters
Copy the Code code as follows:
# Methods for passing variable parameters in PHP call function
Copy the Code code as follows:
Method One
Receives a series of parameters and outputs them individually
function Show_params () {
Get the number of pass parameters
$count = Func_num_args ();
Traversing parameters and outputting them individually
for ($i = 0; $i < $count; $i + +) {
Get parameters
$param = Func_get_arg ($i);
Echo $param. Php_eol;
}
}
Calling functions
Show_params (1, 2, ' Apple ', 3.14);
Method 2
function Show_params () {
To define an array of stored pass parameters
$params = Array ();
Get all parameters
$params = Func_get_args ();
$count = count ($params);
Traverse and output parameters individually
for ($i = 0; $i < $count; $i + +) {
echo $params [$i];
Echo Php_eol;
}
}
Note: Method 2 performs slower than Method 1
The above introduces the QQ space background music player code JS and PHP to function transfer variable parameters of the code, including the QQ space background music player code content, I hope that the PHP tutorial interested friends have helped.