Comparison operator in php
In this example, i show you how to compare values of two variables in php by using not equal to "!=" operator.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Comparison operator</title>
</head>
<body>
<?php
$a= 12;
$b= 12;
if($a != $b) // another symbol used for not equal is '<>'
{
echo "variable a and b are not equal";
}
else{
echo "variable a and b are equal.";
}
?>
</body>
</html>



0 Comments