Home > Backend Development > PHP Tutorial > 基础:关于PHP紧密比较

基础:关于PHP紧密比较

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:48:20
Original
1145 people have browsed it

基础:关于PHP松散比较
比如:
"php"  == true   
请问松散比较两边类型不一致时,是以左右那边类型为准进行转换, 并比较?

是否是 "php"转换为0  ==  true转换为"true"再转换为0 ? 
不懂的是,转换是以左右那边类型为准进行转换并比较
请老鸟指点,谢谢。
------解决方案--------------------
"php"  == true   

任何其他类型与bool 类型比较,其他类型会转换为 bool 类型,这里php会转化true。所以结果为真。

Related labels:
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