title: How to random the order of a list in PHP
body: <p>I have a list of non-repetitive numbers; i need to display all these numbers in a random manner. From <a href="http://www.w3schools.com/php/func_array_rand.asp" rel="nofollow">http://www.w3schools.com/php/func_array_rand.asp</a> I learn a few approaches without luck. If i use "array_rand" all the outputs must be in an increasing order; so my final output will always be in sequential order from 1 to 10 with no randomness.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;?php
  $a=array(1,2,3,4,5,6,7,8,9,10);
  $random_keys=array_rand($a,10);
  echo $a[$random_keys[0]]."&lt;br&gt;";
  echo $a[$random_keys[1]]."&lt;br&gt;";
  echo $a[$random_keys[2]]."&lt;br&gt;";
  echo $a[$random_keys[3]]."&lt;br&gt;";
  echo $a[$random_keys[4]]."&lt;br&gt;";
  echo $a[$random_keys[5]]."&lt;br&gt;";
  echo $a[$random_keys[6]]."&lt;br&gt;";
  echo $a[$random_keys[7]]."&lt;br&gt;";
  echo $a[$random_keys[8]]."&lt;br&gt;";
  echo $a[$random_keys[9]]."&lt;br&gt;";
  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>