title: Algorithm to get all possible string combinations from array up to certain length
body: <p>What is the best algorithm to get all possible string combinations from a given array with a minimum &amp; maximum length value.</p>
  
  <p>Note: This adds complexity since the value is variable unlike the questions these are linked to.</p>
  
  <p>For example:</p>
  
  <pre><code>$letters = array('a','b','c','1','2','3');
  $min_length = 1;
  $max_length = 4;
  
  a
  b
  c
  1
  2
  3
  .
  .
  .
  aaaa
  a123
  b123
  c123
  </code></pre>