例如:

<?php
$a = array(
    "latitude" => 31.219319,
    "longitude" => 121.416821
);
echo json_encode($a);
// 然而却输出来了 {"latitude":31.219318999999999,"longitude":121.416821}

 与我们的精度不同 可以加上 

 

ini_set('serialize_precision',14);

  即可!

相关文章:

  • 2022-12-23
  • 2021-11-03
  • 2021-11-21
  • 2021-12-13
  • 2022-12-23
  • 2022-01-24
  • 2021-12-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-10-06
相关资源
相似解决方案