如果条件0高达100

时间:2016-03-31 11:44:23

标签: php php-5.6

我是新的PHP开发人员,现在我想写,如果条件像0到25意味着我想要显示不同的颜色和25到50意味着我想要显示不同的颜色....高达100我想要这样显示

<?php
    $number = 12 //here value it will come 1 to 100,bassed on $number we have write if condition and and show the different color 
?>

1 个答案:

答案 0 :(得分:2)

<?php 

if($number >= 1 && $number <= 25){
      // code for number between 1 to 25
}
else if($number >= 26 && $number <= 50){
      // code for number between 26 to 50
}
else if($number >= 51 && $number <= 100){
      // code for number between 51 to 100
}
?>