Comparision Operator in Php
<?php
$x=10;
$y="10";
if($x==$y) // equale operator
{
echo "true"."<br>";
}
else
{
echo "false"."<br>";
}
if($x!=$y)
{
echo "true"."<br>";
}
else
{
echo "false"."<br>";
}
if($x===$y) // is identical operator
{
echo "true"."<br>";
}
else
{
echo "false"."<br>";
}
if($x!==$y) // is not identical operator
{
echo "true"."<br>";
}
else
{
echo "false"."<br>";
}
?>
$x=10;
$y="10";
if($x==$y) // equale operator
{
echo "true"."<br>";
}
else
{
echo "false"."<br>";
}
if($x!=$y)
{
echo "true"."<br>";
}
else
{
echo "false"."<br>";
}
if($x===$y) // is identical operator
{
echo "true"."<br>";
}
else
{
echo "false"."<br>";
}
if($x!==$y) // is not identical operator
{
echo "true"."<br>";
}
else
{
echo "false"."<br>";
}
?>
Comparision Operator in Php
Reviewed by Unknown
on
6:21:00 AM
Rating:
No comments: