In the course of converting some code from Java to PHP, I came across the following Java code:
void doSomething(String requiered, String... optionals) {...}
I know it's possible to create a similar function signature using func_get_args()
and I know I could also pass the unknown count of params in an array. However, neither seems straight forward to me, so I was wondering if there might be a better way to have a variable number of arguments in PHP.