title: PHP Random Number Generator Using Array and substr
body: <p>I'm trying to build a simple lottery number generator for my own amusement. I have to pick six numbers between 1 &amp; 49, obviously without repeats.</p>
  
  <p>I have tried using the <code>mt_rand</code> feature for six different variables then echoing them in order, but I guess there is the possibility of repeated numbers. So now I'm trying to get the following to work.</p>
  
  <pre><code>&lt;?php 
  $randomString = substr(shuffle("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49"), 0, 6); echo $randomString; 
  ?&gt;
  </code></pre>
  
  <p>I know that substr is for strings and not arrays but I can't find the alternative.</p>
  
  <p>Anyone got a solution?</p>