Use === in php if statement

This question already has an answer here:

  • Reference — What does this symbol mean in PHP? 18 answers

  • When comparing values in PHP for equality you can use either the == operator or the === operator. What's the difference between the 2? Well, it's quite simple. The == operator just checks to see if the left and right values are equal. But, the === operator (note the extra “=”) actually checks to see if the left and right values are equal, and also checks to see if they are of the same variable type (like whether they are both booleans, ints, etc.).

    http://www.programmerinterview.com/index.php/php-questions/difference-between-and-in-php/

    链接地址: http://www.djcxy.com/p/58608.html

    上一篇: 平等?,eql ?, ===和==有什么区别?

    下一篇: 在php if语句中使用===