I\'ve always done this: if ($foo !== $bar)
if ($foo !== $bar)
But I realized that if ($foo != $bar) is correct too.
if ($foo != $bar)
Double = still works
=
!== should match the value and data type
!= just match the value ignoring the data type
$num = '1'; $num2 = 1; $num == $num2; // returns true $num === $num2; // returns false because $num is a string and $num2 is an integer