title: How to generate unique 6 digit code
body: <p>I want to generate 6 digit unique code but i want first 3 are alphabets and last 3 are numbers like below example..</p>
  
  <pre><code>AAA111
  ABD156
  DFG589
  ERF542...
  </code></pre>
  
  <p>Please help to create code with above combinations..</p>
  
  <p>below is my code..</p>
  
  <pre><code>public function generateRandomString()  {
          $characters = '1234567890';
          $length = 6;
          $charactersLength = strlen($characters);
          $randomString = '';
          for ($i = 0; $i &lt; $length; $i++) {
              $randomString .= $characters[rand(0, $charactersLength - 1)];
          }
          return $randomString;
      }
  </code></pre>