Data type coercion method

一个新手
Release: 2023-03-16 17:24:02
Original
2585 people have browsed it

1. PHP development involves the conversion of data types in many places, especially the data types involving amounts. They must be converted into float types, otherwise there may be errors due to different data types when entering the database. Overwrite the previous amount. (Adding string and float types)

2. Data type forced conversion: forced conversion to float type.

 'total_sum' =>(float)number_format($jmoney,2),
 'reward_sum'=>(float)number_format($jmoney,2),
Copy after login

The above is the detailed content of Data type coercion method. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!