I want to convert variable to float type,but when i encode it to json format it is converted to string format. This is the way I am coverting it, $amt =0.1; $amt = number_format($amt,7); Now, variable value is like : 0.1000000 And after json encoding it is converted to string type like : {"amount":"0.1000000"} But want it as : {"amount":0.1000000}
Please help , how to maintain the float type even if it is json encoded