I am planning to have coordinates sent to the google maps API but i am unable to delete the field name from my json object in order to send the parameters through.
Object {TempPoints: "{lat: 51.478,lng: -3.192},{lat: 51.478,lng: -3.192…{lat: 51.47840998047034,lng: -3.1926937697490536}"}
how do i remove 'TempPoints:' from the object
desired output
Object {"{lat: 51.478,lng: -3.192},{lat: 51.478,lng: -3.192…{lat: 51.47840998047034,lng: -3.1926937697490536}"}
essentially i am trying to recreate something like this
flightPlanCoordinates = [{lat: 51.478,lng: -3.192},{lat: 51.478,lng: -3.192},{lat: 51.478,lng: -3.192},{lat: 51.47845554862494,lng: -3.1928923123350774},{lat: 51.47848027862647,lng: -3.1929894662780804}];
PHP Code as requested
$sql = $dbh->prepare("SELECT TempPoints FROM session WHERE CustomerID = 2 ORDER BY SessionID DESC LIMIT 1");
$sql->execute();
$row = $sql->fetch(PDO::FETCH_ASSOC);
$para = implode(" ",$row);
echo json_encode($row);
Answer
Object {TempPoints: "{lat: 51.478,lng: -3.192},{lat: 51.478,lng: -3.192…{lat: 51.47840998047034,lng: -3.1926937697490536}"}