• notice
  • Congratulations on the launch of the Sought Tech site

A bug that occurs when serialize serializes a round processed decimal

When developing a project last time, I used serialize to serialize a piece of data, and then save it in MYSQL, because One is a decimal number that has been round processed, but after storing it in the database, I saw a very long decimal number in the mysql library, which is very close to the target value, which puzzles me.Let me show you the sample code first.

$array= array( 'user'=>'xiaoming',   'weight'=>180.56898895 ); echo serialize($array span>); exit;  

This is no problem, it will be serialized into: a:2:{s:4:"user";s:8: "xiaoming";s:6:"weight";d:180.56898895;}.But if you put 180.

Tags

Technical otaku

Sought technology together

Related Topic

1 Comments

author

buy lipitor no preion & lt;a href="https://lipiws.top/"& gt;buy atorvastatin 20mg generic& lt;/a& gt; lipitor 20mg for sale

Aifanb

2024-03-07

Leave a Reply

+