How can I get for example:
{"latitude": 35.123000,"longitude": 41.123500,"height": 100.00}
Instead of:
{"latitude": 35.123,"longitude": 41.1235,"height": 100}
I get this output with the following code:
ini_set('serialize_precision', 6);
...
// calculate latitude, longitude and height
...
$response->payload->latitude = rad2deg($latitude);
$response->payload->longitude = rad2deg($longitude);
$response->payload->height = $height;
// some other fields in response..
print(json_encode($response, JSON_PRETTY_PRINT));
I also tried using (float)number_format(...)
but could not get what I want.