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