title: php get two different random array elements
body: <p>From an array</p>
  
  <pre><code> $my_array = array('a','b','c','d','e');
  </code></pre>
  
  <p>I want to get two DIFFERENT random elements.</p>
  
  <p>With the following code:</p>
  
  <pre><code> for ($i=0; $i&lt;2; $i++) {
      $random = array_rand($my_array);  # one random array element number
      $get_it = $my_array[$random];    # get the letter from the array
      echo $get_it;
   }
  </code></pre>
  
  <p>it is possible to get two times the same letter. I need to prevent this. I want to get always two different array elements. Can somebody tell me how to do that?
  Thanks</p>