title: How to insert values into a php array using for loop and condition
body: <p>I wanted to insert values into a php array using conditions like the way below but it is not happening.</p>
  
  <p>Please let me know if there are any other ways to do that since I am getting "undefined offset" error.</p>
  
  <pre><code>$noarray = array();
  
  for ($i=1; $i&lt;=10 ;$i++)
  {
      $noarray[]=$i;
      echo $noarray[$i] . "&lt;br/&gt;"; 
  }
  </code></pre>