What is the use of equals equals equals operator in PHP?

1 answer

Answer

1288313

2026-04-18 14:40

+ Follow


Consider

$var1== $var2 : This means var1 and var2 must be equal in values
$var1=10;
$var2=10;

so $var1==$var2 is true but if $var2=9; then the above statement will be false

now
$var1===$var2

this will check values and their type i.e both should be integer and value should be 10 only then it will return true.

$var2='dummy';
$var1 === $var2 it will return false.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.