src/Marando/AstroDate/AstroDate.php
protected static function ordinal($number)
    {
        $sn = (string)$number;

        if ($number < 11 || $number > 13) {
            if (substr($sn, strlen($sn) - 1, 1) == 1) {
                return 'st';
            }
            if (substr($sn, strlen($sn) - 1, 1) == 2) {
                return 'nd';
            }
            if (substr($sn, strlen($sn) - 1, 1) == 3) {
                return 'rd';
            } else {
                return 'th';
            }
        } else {
            return 'th';
        }
    }
protected static function ordinal($number)
    {
        $sn = (string)$number;

        if ($number < 11 || $number > 13) {
            if (substr($sn, strlen($sn) - 1, 1) == 1) {
                return 'st';
            }
            if (substr($sn, strlen($sn) - 1, 1) == 2) {
                return 'nd';
            }
            if (substr($sn, strlen($sn) - 1, 1) == 3) {
                return 'rd';
            } else {
                return 'th';
            }
        } else {
            return 'th';
        }
    }
Finds the ordinal suffix for a number, e.g. 1st, 2nd, 3rd, etc...

@param  int $number

@return string