PHP中==和===有什么区别 [英] What is the difference between == and === in php

查看:115
本文介绍了PHP中==和===有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
3个不同的等式

Possible Duplicate:
The 3 different equals

php中==和===之间是否有区别?当我在条件语句中使用它们时,两者似乎都对我有效.我对使用PHP编程非常陌生.请考虑一下并用简单的词回答.

Is there any difference between == and === in php? both seem to work fine for me when i use them in a conditional statement. I am very new to programming in PHP. Please consider this and answer in simple words.

推荐答案

  • $a == $b
    • $a == $b
    • 等于true :如果$a等于 $b,键入杂耍后.

      Equal true: if $a is equal to $b, after type juggling.

      • $a === $b

      完全相同:如果$a等于$b,并且它们是相同类型.

      Identical true: if $a is equal to $b, and they are of the same type.

      这篇关于PHP中==和===有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆