You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
2.4 KiB
102 lines
2.4 KiB
<?php
|
|
|
|
declare(strict_types=1);
|
|
namespace tts\arrays;
|
|
|
|
class common_stuff {
|
|
|
|
public static function get_ordinal_number_suffix(int $number): string {
|
|
$number = abs($number);
|
|
if (in_array(($number % 100),array(11,12,13))){
|
|
return 'th';
|
|
}
|
|
switch ($number % 10) {
|
|
case 1: return 'st';
|
|
case 2: return 'nd';
|
|
case 3: return 'rd';
|
|
default: return 'th';
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Fetch Months
|
|
* @return array of months
|
|
*/
|
|
public static function months(): array {
|
|
return array(
|
|
'1' => 'January',
|
|
'2' => 'February',
|
|
'3' => 'March',
|
|
'4' => 'April',
|
|
'5' => 'May',
|
|
'6' => 'June',
|
|
'7' => 'July',
|
|
'8' => 'August',
|
|
'9' => 'September',
|
|
'10' => 'October',
|
|
'11' => 'November',
|
|
'12' => 'December'
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Fetch States in USA
|
|
* @return array of states
|
|
*/
|
|
public static function states_array(): array {
|
|
return array(
|
|
'AL' => 'Alabama',
|
|
'AK' => 'Alaska',
|
|
'AZ' => 'Arizona',
|
|
'AR' => 'Arkansas',
|
|
'CA' => 'California',
|
|
'CO' => 'Colorado',
|
|
'CT' => 'Connecticut',
|
|
'DE' => 'Delaware',
|
|
'DC' => 'District of Columbia',
|
|
'FL' => 'Florida',
|
|
'GA' => 'Georgia',
|
|
'HI' => 'Hawaii',
|
|
'ID' => 'Idaho',
|
|
'IL' => 'Illinois',
|
|
'IN' => 'Indiana',
|
|
'IA' => 'Iowa',
|
|
'KS' => 'Kansas',
|
|
'KY' => 'Kentucky',
|
|
'LA' => 'Louisiana',
|
|
'ME' => 'Maine',
|
|
'MD' => 'Maryland',
|
|
'MA' => 'Massachusetts',
|
|
'MI' => 'Michigan',
|
|
'MN' => 'Minnesota',
|
|
'MS' => 'Mississippi',
|
|
'MO' => 'Missouri',
|
|
'MT' => 'Montana',
|
|
'NE' => 'Nebraska',
|
|
'NV' => 'Nevada',
|
|
'NH' => 'New Hampshire',
|
|
'NJ' => 'New Jersey',
|
|
'NM' => 'New Mexico',
|
|
'NY' => 'New York',
|
|
'NC' => 'North Carolina',
|
|
'ND' => 'North Dakota',
|
|
'OH' => 'Ohio',
|
|
'OK' => 'Oklahoma',
|
|
'OR' => 'Oregon',
|
|
'PA' => 'Pennsylvania',
|
|
'RI' => 'Rhode Island',
|
|
'SC' => 'South Carolina',
|
|
'SD' => 'South Dakota',
|
|
'TN' => 'Tennessee',
|
|
'TX' => 'Texas',
|
|
'UT' => 'Utah',
|
|
'VT' => 'Vermont',
|
|
'VA' => 'Virginia',
|
|
'WA' => 'Washington',
|
|
'WV' => 'West Virginia',
|
|
'WI' => 'Wisconsin',
|
|
'WY' => 'Wyoming',
|
|
);
|
|
}
|
|
|
|
} |