title: How to randomly generate a number from a range of numbers but exclude some numbers?
body: <p>How would I generate a random number from a range of numbers between 1 and 10 while excluding an array of numbers e.g. 4,5,6.</p>
  
  <pre><code>$exclude = array(4,5,6);
  </code></pre>
  
  <p>The following code allows to generate random numbers within a range however only for a single number and not an array of numbers</p>
  
  <pre><code>function randnumber() {
      do {
      $numb = rand(1,10);
  } while ($varr == 4);
  return $numb;
  }
  </code></pre>