[ create a new paste ] login | about

Link: http://codepad.org/2glDh39K    [ raw code | output | fork ]

PHP, pasted on Sep 30:
<?php

$number = 0;

        switch ($number) {
         case ($number <= 10000):
                echo "0-10K";
               break;
            case ($number > 10000 && $number <= 20000):
                echo "10-20K";
                break;
            case ($number > 20000 && $number <= 30000):
                echo "20-30K";
                break;
            case ($number > 30000 && $number <= 40000):
                echo "30-40K";
                break;
            case ($number > 40000 && $number <= 50000):
                echo "40-50K";
                break;
            case ($number > 50000 && $number <= 60000):
                echo "50-60K";
                break;
            case ($number > 60000 && $number <= 70000):
                echo "60-70K";
                break;
            case ($number > 70000 && $number <= 80000):
                echo "70-80K";
                break;
            case ($number > 80000 && $number <= 90000):
                echo "80-90K";
                break;
            case ($number > 90000):
                echo "90K+";
                break;

            default: //default
                echo "N/A";
                break;
}

?>


Output:
1
10-20K


Create a new paste based on this one


Comments: