Answer the question
In order to leave comments, you need to log in
PHP json returning strings not numbers?
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
$response = json_decode($response, true);
Answer the question
In order to leave comments, you need to log in
const json = { float: 439000.0 }
JSON.stringify(json); // '{"float":439000}'
<?php
$test = [
"price" => 4390.00
];
echo json_encode($test, JSON_PRESERVE_ZERO_FRACTION);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question