How to Compare Numeric Variables with PHP

1 · Josh Sherman · Aug. 30, 2013, midnight
Comparing numeric values is a very common programming task. Which number is greater? is lesser? equal? In PHP like any C-style language, you can do these comparisons with a simple if ( ... ) { ... } statement: if ($var1 > $var2) { echo $var1 . ' is greater than......