This commit is contained in:
2020-09-17 19:10:38 +08:00
parent cc80e0ca31
commit c4c5806914
3 changed files with 12 additions and 4 deletions
+2 -1
View File
@@ -38,13 +38,14 @@ class JSON
*/
private static function filter($data)
{
array_walk_recursive($data, function (&$value, $key) {
array_walk_recursive($data, function ($value, $key) use ($data) {
if (!is_numeric($value)) {
return;
}
if (is_int(+$value)) {
$value = +$value;
}
$data[$key] = $value;
});
return json_encode($data, JSON_UNESCAPED_UNICODE);
}