$a = 1
$b = 2
If ($a = $b) <--- this will be TRUE
because it makes first $a and $b the same, then gives only false, when it returned an errormessage. basicly you say here: Make $a and $b the same, if you succeeded, then continue.
you need this:
If ($a == $b) <--- FALSE
$a = true
$b = 1
if ($a == $b) <--- TRUE, (true and 1 are the same)
if ($a === $b) <--- FALSE (true and 1 are not the same)
if you want NOT true, then use
!= in stead of ==
and !== in stead of ===
So basicly:
= means 'Make the same'
== means 'If they are the same'
=== means 'If the are the same AND the same type' (numeric, bolean, alpha, etc)
!= means 'Not the same'
!== means 'Not the same OR not the same type'
There are a few more, if you like them, just ask 🙂