title: Shuffle and randomize string without repeat in PHP
body: <p>I have a set of variables (strings), loaded from a database, or from an array:</p>
  
  <p>"AA","BB","CC","DD","EE","FF","GG", ... and so on (about 100 of them)</p>
  
  <p>I would need to be able to 1) calculate all possible variations 2) without repeating strings and 3) limit them to 5 strings per variation:</p>
  
  <p>So for example (result):</p>
  
  <pre><code>Set 1: AA BB CC DD EE
  Set 2: AA CC BB EE DD
  Set 3: CC BB EE FF GG
  Set 4: GG AA BB CC EE
  Set 5: CC EE AA BB GG
  ... and so on
  </code></pre>
  
  <p>I have come across <a href="https://stackoverflow.com/questions/5506888/permutations-all-possible-sets-of-numbers">the permutations function</a> and the <a href="http://php.net/manual/en/function.shuffle.php" rel="nofollow noreferrer">php shuffle function</a> but i do not know how to modify them to suit the limitation of items per result set?</p>