title: store array values in another array using for loop in php
body: <p>store array values in another array using for loop in php    </p>
  
  <pre><code>    $sql = "select id,user_email,username,full_name from registration";        
      $connection = Yii::app()-&gt;db;
      $command = $connection-&gt;createCommand($sql);
      $rows = $command-&gt;queryAll();
      $email_arr = []; 
         for ($i=0; $i &lt;=count($rows); $i++) { 
            $email_arr[] = $rows[$i]['user_email'];
         }
  </code></pre>
  
  <p>i am getting undefined offset 39 php error anyone can help me please</p>