when their values are checked.Ok, so what is the use of ===. The following example illustrates it.
<?php $a=10; $b='10'; if($a==$b) echo 'Same'; if($a===$b) echo 'Not same'; ?>It will output 'same'. This is because == checks only for the value, not the datatype whereas === also checks for the datatype since $b='10', it is considered as character instead of integer.
No comments:
Post a Comment