Adsense 728 * 15

Search

Custom Search

Triple Equal to in PHP



Triple Equal to (===)


Triple equal to compares value as well as data type.


Example-




<?php



$value1=20;
$value2='20';


if($value1==$value2) //Both value 1 and Value 2 are different data type
{
echo 'Equal';
}
else
{
echo 'unequal';
}

?>

Output-

Equal

Now use Triple Equal to in php

<?php



$value1=20;
$value2='20';


if($value1===$value2) //Both value 1 and Value 2 are different data type
{
echo 'Equal';
}
else
{
echo 'unequal';
}

?>

Output

Unequal

No comments:

Post a Comment