public static function ordinalize($number)
    {
        if (in_array(($number % 100), range(11, 13))) {
            return $number . 'th';
        }
        switch ($number % 10) {
            case 1:
                return $number . 'st';
            case 2:
                return $number . 'nd';
            case 3:
                return $number . 'rd';
            default:
                return $number . 'th';
        }
    }
public static function ordinalize($number)
    {
        if (in_array(($number % 100), range(11, 13))) {
            return $number . 'th';
        }
        switch ($number % 10) {
            case 1:
                return $number . 'st';
            case 2:
                return $number . 'nd';
            case 3:
                return $number . 'rd';
            default:
                return $number . 'th';
        }
    }
public static function ordinalize ( $ number ) { if ( in_array ( ( $ number % 100 ) , range ( 11 , 13 ) ) ) { return $ number . 'th' ; } switch ( $ number % 10 ) { case 1 : return $ number . 'st' ; case 2 : return $ number . 'nd' ; case 3 : return $ number . 'rd' ; default : return $ number . 'th' ; } }
Converts number to its ordinal English form. For example, converts 13 to 13th, 2 to 2nd ...
@param integer $number the number to get its ordinal value
@return string
Converts number to its ordinal English form . For example converts 13 to 13th 2 to 2nd ...