How to write a function to output unconstant loop
Posted
by tunpishuang
on Stack Overflow
See other posts from Stack Overflow
or by tunpishuang
Published on 2010-04-13T04:38:01Z
Indexed on
2010/04/13
4:53 UTC
Read the original article
Hit count: 319
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,2,4,5)
: this will output values like below:
1_4 1_5 2_4 2_5
The number of array $argv's is not constant. Maybe 3 or 4 levels of loop will be outputed.
I know this will used RECURSIVE , but i don't know exactly how to code.
© Stack Overflow or respective owner