What does === do in PHP

后端 未结 8 1737
天涯浪人
天涯浪人 2021-01-05 23:25

I have been programming in PHP for a while but I still dont understand the difference between == and ===. I know that = is assignment. And == is equals to. So what is the pu

8条回答
  •  一个人的身影
    2021-01-05 23:58

    It will check if the datatype is the same as well as the value

    if ("21" == 21) // true
    if ("21" === 21) // false
    

提交回复
热议问题