I am pulling JSON data from a webserver using the following PHP code
$result = mysql_query("select lat,lng from gpsdata limit 10");
$rows = array();
while($r = mysql_fetch_assoc($result)) {
$rows[] = $r;
}
print json_encode($rows);
I am using Javascript to get this data with this
$.getJSON('returngps.php').done(function(data) {
for (var i=0;i< data.length;i++ ){
console.log(data[i]);
}
}
My issue is the data I am getting returned. The output I am currently getting is:
{lat: "53.399793333333", lng: "-6.3844516666667"}
What I want to work with is:
{lat: 53.399793333333, lng: -6.3844516666667}
Is there a way to convert this?