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.
Now I want to create an array which should contain all the arrays returned by the explode function.
$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 '<br/>';
//$long=array();
$long=$altitude[1];
//print_r($long);
//echo '<br/>';
}
below is a static array defined:
<?php
$phpArray = array(array('Vadodara',22.3000,73.2000,5),
array('Valsad',20.6300,72.9300,2),
array('Thane',19.1724,72.9570,1));
)?>
I want $phpArray to have dynamic values generated from the query above