Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$x = 1000.00125;
//echo number_format($x, 2, '.', '');
echo json_encode(['x' => number_format((float)$x, 2, '.', '')], JSON_PRESERVE_ZERO_FRACTION);