title: Store array in while loop to use outside
body: <p>I would like to store value from while loop but not in multidimensional way :</p>
  
  <pre><code> $movies_id = array();
  
   while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
                  $id = $row['id'];
                  $title_id = $row['title_id'];
                      $movies_id[] = [$id =&gt; $title_id];
       }
  
  print_r($movies_id);
  </code></pre>
  
  <p>I am not getting the way, how to do it, if i just write <code>$movies_id = [$id =&gt; $title_id];</code> it only shows the last value. </p>
  
  <p>Thank you by advance.</p>