Here is the function description
test($argv)
$argv
is an array, for example $argv=array($from1,$to1,$from2,$to2.....);
array items must be even.
$argv=array(1,3,4,5)
: this will output values like below:
1_4
1_5
2_4
2_5
3_4
3_5
pseudocode is like
while($from1<=$to1){
while($from2<=$to2){
echo $from1."_".$from2."<br/>";
$from2++;
}
$from1++;
}
$argv=array(1,2,3,4,5,6)
: this will output values like below:
1_3_5
1_3_6
1_4_5
1_4_6
2_3_5
2_3_6
2_4_5
2_4_6
pseudocode is like
while($from1<=$to1){
while($from2<=$to2){
while($from3<=$to3){
echo $from1."_".$from2."_".$from3."<br/>";
$from3++;
}
$from2++;
}
$from1++;
}
The number of array $argv's is not constant. Maybe 3 or 4 levels of loop will be outputed.
i just heard that tail recuision or iteration will be used, but i don't know exactly how to code.