I have four conditions that I need to go through and I thought it would be best to use the switch statement in PHP. However, I need to check whether an integer
switch
A more general case for solving this problem is:
switch (true) { case $count <= 20: $priority = 'low'; break; case $count <= 40: $priority = 'medium'; break; case $count <= 60: $priority = 'high'; break; default: $priority = 'severe'; break; }