Why does this code echo Yes.
even though variables are not equal!
$a = '0e462097431906509019562988736854';
$b = '0e830400451993494058024219903391';
if( $a == $b ) echo 'Yes.';
else echo 'No!';
Why does this code echo Yes.
even though variables are not equal!
$a = '0e462097431906509019562988736854';
$b = '0e830400451993494058024219903391';
if( $a == $b ) echo 'Yes.';
else echo 'No!';
try it, with using strcmp function:
if(int strcmp ($a,$b)===0) echo 'Yes.';
else echo 'No!';
Try using '===' instead of '=='.
'==' has a "weaker" comparison because it does not check for type.
'===' on the other hand, checks for the type as well, and it is generally good practice to be more explicit when you compare two things.