Does php have a decimal part? is it. 3? is there a vulnerability solution?

Source: Internet
Author: User
Does php have a decimal part? is it. 3? is there a vulnerability? get a value from the html page, read a value from the database, and determine if they are not equal, to do something (! =) When the decimal part of two digits is. 3. an error is returned. for example, if the two numbers are both 54.3 or 55.3, the true value should be false. if the decimal part is other, there is no problem. Is there any fractional part in php. 3. is there a vulnerability?
Get a value from the html page, read a value from the database, and determine if they are not equal to each other to do something (! =) When the decimal part of the two digits is. 3, the system determines that it is incorrect;
For example, if both the numbers are 54.3 or 55.3, it determines that "true" should be "false". if the decimal part is other, there is no problem, such as "54.2 ".
Have you ever met?

------ Solution --------------------
No problem... Your code is faulty or your brain is short-circuited.
PHP code
Var_dump (54.3! = 55.3); // bool (true)
------ Solution --------------------
No problems were found during multiple tests.
------ Solution --------------------
PHP code
    "; Echo '$ var [\ 'peilv \']: ', $ var ['peilv'],' $ tempCurPeilv: ', $ tempCurPeilv; var_dump ($ var ['peilv']! = $ TempCurPeilv );
------ Solution --------------------
Fool's Day haha
PHP code
Boolean trueboolean false $ var ['peilv']: 55.3 $ tempCurPeilv: 55.3 boolean false
------ Solution --------------------
Because your comparison has changed to a string, a floating point, or another type, the result shows an exception.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.