Skip to content

Instantly share code, notes, and snippets.

@lroman242
Created January 14, 2020 19:35
Show Gist options
  • Save lroman242/9b003262ce6b89db68757b9cbd1e2460 to your computer and use it in GitHub Desktop.
Save lroman242/9b003262ce6b89db68757b9cbd1e2460 to your computer and use it in GitHub Desktop.
medium json_encode codeblock 18
$data = [
"0000021", // нули слева
6.12345678910111213, // много знаков после точки (будет округленно)
"+81011321515", // телефон
"21E021", // экспоненциальная запись
];
echo json_encode($data, JSON_NUMERIC_CHECK);
//[
// 21,
// 6.1234567891011,
// 81011321515,
// 2.1e+22
// ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment