How to use comparison operators in switch statement in PHP

<?php
$number = 27;

switch(true)
{
    case ($number > 100):
        echo 'Bigger than hundred';
    break;
  
    case ($number < 100):
        echo 'Lower than hundred';
    break;
  
    default:
        echo 'Equal to hundred';
    break;
}
?>

Comments

Popular posts from this blog

Timus Problem 1086. Cryptography Accepted Solution in C