title: How to put random number in array and showing this array in php
body: <p>Recently I made a program to create 4 random numbers I want to put these numbers in an array but I did not echo the array's numbers : </p>
  
  <p>my code is:</p>
  
  <pre><code> &lt;?php
      $numbers = array();
      function rand_num_generator() {
      return rand(1000,9999);
      }
      for($i=0;$i&lt;4;$i++) {
      $number[i] = rand_num_generator();
      }
      echo $number[2];
  ?&gt;
  </code></pre>
  
  <p>Here i am not able to access array using their index values.</p>