Can I create a PHP function which will accept either integer or array values? Can the logic be determined upon reaching the function, or should it be done prior to calling it? (i.e. I want to avoid using one function for arrays, and another for single integers.)
I could have two arguments one integer, one array, and then call the function with one as null. But is a scenario where I don't know the type at the moment it would be called.
function my_function($integer, array $array)
{
$integer = '';
...
Perhaps, before calling my function, I should convert my integer into a single keyed array so it wouldn't matter.