title: create dynamic array within a array php
body: <p>I have an sql query that returns the altitude of a place. I have exploded the result to separate longitude and latitude. The result is stored in array.</p>
  
  <p>Now I want to create an array which should contain all the arrays returned by the explode function.</p>
  
  <pre><code>$sql_altitude = mysql_query("SELECT altitude FROM `navigatio_info`
                                               WHERE bus_id='$bus_id'
                                               AND driver_id ='$driver_id' 
                                               ORDER BY stop_no ASC 
                                               LIMIT 0 , 30");
  while ($row = mysql_fetch_assoc($sql_altitude)) 
   {
     //echo $row['altitude'];
     //$altitude=array();
     $altitude=(explode("-",$row['altitude']));
     print_r($altitude);
     //$lat=array();
     $lat=$altitude[0];
     //print_r($lat);
     echo '&lt;br/&gt;';
     //$long=array();
     $long=$altitude[1];
     //print_r($long);
     //echo '&lt;br/&gt;';
  }
  </code></pre>
  
  <p>below is a static array defined:</p>
  
  <pre><code> &lt;?php 
     $phpArray = array(array('Vadodara',22.3000,73.2000,5),
                       array('Valsad',20.6300,72.9300,2),
                       array('Thane',19.1724,72.9570,1));
   )?&gt;
  </code></pre>
  
  <p>I want $phpArray to have dynamic values generated from the query above</p>