title: Insert values to php multidimensional array
body: <p>How can I insert values into a multidimensional array in php? I need to add more and more rows to array using a while loop.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>$size=10;
  $p=0;
  while($p&lt;$size)
  {
      $myarray = array(
          array("number"=&gt;$data[$p],"data"=&gt;$kkk[1],"status"=&gt;"A"),
          array("number"=&gt;$data[$p],"data"=&gt;$kkk[1],"status"=&gt;"A"));
      // Each time the loop executes, I need to add more array to myarray.
      $p++;
  }
  </code></pre>