if($a > $b){ echo "A > B"; }else if($a < $b){ echo "A < B"; }else if($a != ""){ if($a == $b){ echo "A = B"; } }