Php forced type conversion

Source: Internet
Author: User
Php forced type conversion

Forced type conversion in php usually occurs in the environment where arithmetic operators are involved. arithmetic operators are common numeric operators. The operated content is generally called an operation object or operand.

Arithmetic operators are usually used for integer or double-precision (also known as floating point or real number) data. If the object involved in arithmetic operations contains strings, php will try to convert these strings into a number. If it contains the character "e" or "E", it will be treated as a scientific notation and converted to a floating point number. Otherwise, it will be converted to an integer.

Php searches for numbers at the beginning of the string and uses these numbers as the value of the string. If no number is found, the value of the string is 0.

Php

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.