Q: How to preserve decimal places in PHP json encode? Have the below code. want to preserve all the decimal places of the latitude but json_encode truncates last two digits.  How can i preserve all the decimal place when i do json_encode. I want the values as numeric in json output and dont want as string enclosed in  quotes.
print_r(array('lat' => '-33.661853351608244' ));
echo json_encode( array('lat' => '-33.661853351608244' ),JSON_NUMERIC_CHECK);

Output:
Array
(
    [lat] => -33.661853351608244
)
{"lat":-33.661853351608}


A: You can set precision to desired decimal places
ini_set( 'precision', 17 );
$arr = array(
  'lat' =>  "-33.661853351608244"
);

echo json_encode($arr,JSON_NUMERIC_CHECK);

Output:-
{"lat":-33.661853351608244}


A: I encountered this inconsistency of JSON_NUMERIC_CHECK with phone numbers starting with a zero. I solved the problem by encapsulating the phone number, between two empty chains like this:
$pre_tel = "0606060606";
$tel = " ".$pre_tel." ";

