Comparing numbers and strings : Comparison Operators « Operator « PHP






Comparing numbers and strings

 
<?
// These values are compared using dictionary order
if ("x54321" > "x5678") {
    print 'The string "x54321" is greater than the string "x5678".';
} else {
    print 'The string "x54321" is not greater than the string "x5678".';
}
  
  








Related examples in the same category

1.Comparison Operators
2.Loose Comparison Operators
3.Using Comparison Operators in if Statements
4.The Ternary Operator
5.The equality 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