title: How can i modify the php code to recieve 5 numbers without duplicates/repeating numbers?
body: <p>i have this php code:</p>
  
  <pre><code>&lt;?php
  function GetRand($N, $min=1, $max=59) {
  $Local = array();
  mt_srand(time());
  for ($i=0;$i&lt;$N;$i++) 
  $LocalArr [] = mt_rand($min, $max); 
  return $LocalArr;
  }
  $A = GetRand(5);
  foreach($A as $K=&gt;$v) echo "$v ";
  ?&gt;
  </code></pre>
  
  <p>The result is 5 numbers between 1 and 59. The problem is that sometimes i receive results like this:</p>
  
  <p>43  9  13  9  7
  In those 5 numbers, there is the number 9 twice. I would like to change the php code, so everytime when there is a number that repeats, this number should be skipped and instead of the repeated number should be represented another number, so that every time i have 5 numbers and no duplicates between them.</p>
  
  <p>Thank you very much in Advance!</p>