How do you explicitly declare a function to accept any number of parameters? function foo(@multi $params) {} function foo(<multi> $params) {} function foo(...$params) {} This is not possible in PHP. code example

Example: php functions parameters

// functions require 'function' keyword
// separate the parameters with a comma
function addFunction($num1, $num2) {
	$sum = $num1 + $num2;
	echo "Sum of the two numbers is : $sum";
}

addFunction(1, 2); // echoes: Sum of the two numbers is : 3

Tags:

Php Example