mardi 6 octobre 2015

If-statement with !== is never true PHP

I have this if-statement which appears to never be true, regardless of the value of $xOffsetMR and $xOffsetSP.

if ($xOffsetSP !== $xOffsetMR){
            $xOffsetSP == $xOffsetMR;
            }

Both of them are numbers and when I check them in my console (I send them from php to javascript using ajax), I get $xOffsetSP = 0 and $xOffsetMR = 1170.

Then, why does it never run the if-statement?

I know that I am in the right place of my code since i can change $xOffsetSP by using $xOffsetSP = 10; right before the statement.

Aucun commentaire:

Enregistrer un commentaire