title: Generating all 6 character alphanumeric combinations (upper and lower case)
body: <p>I am trying to figure out a way to generate a list of every possible 6 character alphanumber string where upper and lower case letters are treated as unique letters. Using the following functions we can generate the strings using lowercase letters and numbers:</p>
  
  <pre class="lang-php prettyprint-override"><code>function increasePosition(&amp;$cString, $nPosition) {
      //get the char of the current position
      $cChar = substr($cString, $nPosition - 1, 1);
  
      //convert to the ascii value (and add one)
      $nChar = ord($cChar) + 1;
  
      if ($nChar == 58) {
          $nChar = 97; //one past 9, go to a
      }
  
      if ($nChar == 123) {
          $nChar = 48; //one past z, go to 0
          //we hit z, so increase the next space to the left
          increasePosition($cString, $nPosition - 1);
      }
  
      //replace the expected position with the new character
      $cString[$nPosition - 1] = chr($nChar);
  }
  
  function myCombinations($nSize) {
      //init to 0 repeating.
      $cString = str_repeat('0', $nSize);
      //move the last character 'back' one, so that 0 repeating will be the first item.
      $cString[$nSize - 1] = '/';
      //when to stop.
      $cEnd = str_repeat('z', $nSize);
  
      while ($cString != $cEnd) {
          increasePosition($cString, $nSize);
          print($cString . " ");
      }
  }
  
  myCombinations(2);
  </code></pre>
  
  <p><a href="https://stackoverflow.com/a/32524299/1538275">Source</a></p>
  
  <p>However, this doesn't take into account uppercase letters. Is it possible to use both upper and lower case letters in this sort of algorithm in PHP?</p>