Home  >  Article  >  Backend Development  >  php cast type conversion

php cast type conversion

WBOY
WBOYOriginal
2016-07-25 08:45:582013browse

Forced type conversion in PHP generally occurs in environments where arithmetic operators are involved. Arithmetic operators are relatively common numeric operators. The content being manipulated is generally called the operand or operand.

Arithmetic operators are typically used on data of type integer or double (also known as floating point or real). If there are strings in the objects involved in arithmetic operations, PHP will try to convert these strings into a number. If it contains the "e" or "E" character, it is treated as scientific notation and converted to a floating point number, otherwise it is converted to an integer.

php will look for numbers at the beginning of the string and use those numbers as the value of the string. If no number is found, the value of the string will be 0.

php


Statement:
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