0

I have a function that has 5 requqired parameters and 2 optional ones. So a user can input 5-7 parameters and they are stored inside of an array. How can I pass those values to the function, is there something similar like extract() that returns the values and not the numbers?

E.g.:

$arr = ['one', 'two', 'three', 'four', 'five', 'six'];
functionname($arr[0], $arr[1], $arr[2],$arr[3],$arr[4],$arr[5])

doesn't work, because I never know for sure if the sixth parameter really exists. Thanks for any help.

kledo-34
  • 33
  • 5

0 Answers0