Created
January 14, 2020 19:35
-
-
Save lroman242/9b003262ce6b89db68757b9cbd1e2460 to your computer and use it in GitHub Desktop.
medium json_encode codeblock 18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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