php强制类型转换

WBOY
Release: 2016-07-25 08:45:58
Original
1911 people have browsed it

php中的强制类型转换一般出现在算术运算符参与的环境中,算术运算符是比较常见的数字操作符,被操的内容我们一般称之为运算对象或操作数。

算术运算符通常用于整形或双精度(又称为浮点或实数)类型的数据。如果参与算术运算的对象中有字符串,php会试图将这些字符串转换成一个数字。如果其中包含“e”或“E”字符,它就会被当做是科学表示法并被转换成浮点数,否则将会被转换成整数。

php会在字符串开始处寻找数字,并且使用这些数字作为该字符串的值,如果没有找到数字,该字符串的值为0。

php


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!