The equality operator : Comparison Operators « Operator « PHP






The equality operator

 
<?

$new_messages = 10

if ($new_messages == 10) {
    print "You have ten new messages.";
}

if ($new_messages == $max_messages) {
    print "You have the maximum number of messages.";
}



if ($dinner == 'B') {
    print "B.";
}
?>
  
  








Related examples in the same category

1.Comparison Operators
2.Comparing numbers and strings
3.Loose Comparison Operators
4.Using Comparison Operators in if Statements
5.The Ternary Operator
6.These values are compared using dictionary order
7.These values are compared using numeric order
8.Equality Operators summary table
9.Equality Operators in action