title: Create a multidimensional array in a loop
body: <p>I am trying to create an array like this in a loop:</p>
  
  <pre><code>$dataPoints = array(
      array('x' =&gt; 4321, 'y' =&gt; 2364),
      array('x' =&gt; 3452, 'y' =&gt; 4566),
      array('x' =&gt; 1245, 'y' =&gt; 3452),
      array('x' =&gt; 700, 'y' =&gt; 900), 
      array('x' =&gt; 900, 'y' =&gt; 700));
  </code></pre>
  
  <p>with this code </p>
  
  <pre><code>$dataPoints = array();    
  $brands = array("COCACOLA","DellChannel","ebayfans","google",
      "microsoft","nikeplus","amazon"); 
  foreach ($brands as $value) {
      $resp = GetTwitter($value);
      $dataPoints = array(
          "x"=&gt;$resp['friends_count'],
          "y"=&gt;$resp['statuses_count']);
  }
  </code></pre>
  
  <p>but when loop completes my array looks like this:</p>
  
  <pre><code>Array ( [x] =&gt; 24 [y] =&gt; 819 ) 
  </code></pre>