Possible Duplicate:
PHP 2D Array output all combinations
I need to test the behavior of a certain function with a significant number of possible inputs. Say the function signatures are as follows:
foo ($a)
foo ($a, $b, $c)
Say $a
can have the following values: 1, 2.
Say $b
can have the following values: 'hello'
, 'world'
.
Say $c
can have the following values: TRUE
, FALSE
How to write a function that returns the following combinations:
1
2
1,hello,TRUE
1,hello,FALSE
2,hello,TRUE
2,hello,FALSE
1,world,TRUE
1,world,FALSE
...
Note that the number of function's parameters are unknown and so are their possible values.