Add list of states for more countries

This commit is contained in:
Hadi Nategh 2018-09-24 14:23:58 +02:00
parent 2010850c16
commit 475a25b66c

View File

@ -422,6 +422,285 @@ class Country
'9' => 'Wien'
);
/**
* List of GB states as 3-letter code => name pairs
*
* @var array
*/
protected static $gb_states_array = array(
'BKM' => 'Buckinghamshire',
'CAM' => 'Cambridgeshire',
'CMA' => 'Cumbria',
'DBY' => 'Derbyshire',
'DEV' => 'Devon',
'DOR' => 'Dorset',
'ESX' => 'East Sussex',
'ESS' => 'Essex',
'GLS' => 'Gloucestershire',
'HAM' => 'Hampshire',
'HRT' => 'Hertfordshire',
'KEN' => 'Kent',
'LAN' => 'Lancashire',
'LEC' => 'Leicestershire',
'LIN' => 'Lincolnshire',
'NFK' => 'Norfolk',
'NYK' => 'North Yorkshire',
'NTH' => 'Northamptonshire',
'NTT' => 'Nottinghamshire',
'OXF' => 'Oxfordshire',
'SOM' => 'Somerset',
'STS' => 'Staffordshire',
'SFK' => 'Suffolk',
'SRY' => 'Surrey',
'WAR' => 'Warwickshire',
'WSX' => 'West Sussex',
'WOR' => 'Worcestershire',
'LND' => 'London',
'BDG' => 'Barking and Dagenham',
'BNE' => 'Barnet',
'BEX' => 'Bexley',
'BEN' => 'Brent',
'BRY' => 'Bromley',
'CMD' => 'Camden',
'CRY' => 'Croydon',
'EAL' => 'Ealing',
'ENF' => 'Enfield',
'GRE' => 'Greenwich',
'HCK' => 'Hackney',
'HMF' => 'Hammersmith and Fulham',
'HRY' => 'Haringey',
'HRW' => 'Harrow',
'HAV' => 'Havering',
'HIL' => 'Hillingdon',
'HNS' => 'Hounslow',
'ISL' => 'Islington',
'KEC' => 'Kensington and Chelsea',
'KTT' => 'Kingston upon Thames',
'LBH' => 'Lambeth',
'LEW' => 'Lewisham',
'MRT' => 'Merton',
'NWM' => 'Newham',
'RDB' => 'Redbridge',
'RIC' => 'Richmond upon Thames',
'SWK' => 'Southwark',
'STN' => 'Sutton',
'TWH' => 'Tower Hamlets',
'WFT' => 'Waltham Forest',
'WND' => 'Wandsworth',
'WSM' => 'Westminster',
'BNS' => 'Barnsley',
'BIR' => 'Birmingham',
'BOL' => 'Bolton',
'BRD' => 'Bradford',
'BUR' => 'Bury',
'CLD' => 'Calderdale',
'COV' => 'Coventry',
'DNC' => 'Doncaster',
'DUD' => 'Dudley',
'GAT' => 'Gateshead',
'KIR' => 'Kirklees',
'KWL' => 'Knowsley',
'LDS' => 'Leeds',
'LIV' => 'Liverpool',
'MAN' => 'Manchester',
'NET' => 'Newcastle upon Tyne',
'NTY' => 'North Tyneside',
'OLD' => 'Oldham',
'RCH' => 'Rochdale',
'ROT' => 'Rotherham',
'SHN' => 'St. Helens',
'SLF' => 'Salford',
'SAW' => 'Sandwell',
'SFT' => 'Sefton',
'SHF' => 'Sheffield',
'SOL' => 'Solihull',
'STY' => 'South Tyneside',
'SKP' => 'Stockport',
'SND' => 'Sunderland',
'TAM' => 'Tameside',
'TRF' => 'Trafford',
'WKF' => 'Wakefield',
'WLL' => 'Walsall',
'WGN' => 'Wigan',
'WRL' => 'Wirral',
'WLV' => 'Wolverhampton',
'BAS' => 'Bath and North East Somerset',
'BDF' => 'Bedford',
'BBD' => 'Blackburn with Darwen',
'BPL' => 'Blackpool',
'BMH' => 'Bournemouth',
'BRC' => 'Bracknell Forest',
'BNH' => 'Brighton and Hove',
'BST' => 'Bristol, City of',
'CBF' => 'Central Bedfordshire',
'CHE' => 'Cheshire East',
'CHW' => 'Cheshire West and Chester',
'CON' => 'Cornwall',
'DAL' => 'Darlington',
'DER' => 'Derby',
'DUR' => 'Durham, County',
'ERY' => 'East Riding of Yorkshire',
'HAL' => 'Halton',
'HPL' => 'Hartlepool',
'HEF' => 'Herefordshire',
'IOW' => 'Isle of Wight',
'IOS' => 'Isles of Scilly',
'KHL' => 'Kingston upon Hull',
'LCE' => 'Leicester',
'LUT' => 'Luton',
'MDW' => 'Medway',
'MDB' => 'Middlesbrough',
'MIK' => 'Milton Keynes',
'NEL' => 'North East Lincolnshire',
'NLN' => 'North Lincolnshire',
'NSM' => 'North Somerset',
'NBL' => 'Northumberland',
'NGM' => 'Nottingham',
'PTE' => 'Peterborough',
'PLY' => 'Plymouth',
'POL' => 'Poole',
'POR' => 'Portsmouth',
'RDG' => 'Reading',
'RCC' => 'Redcar and Cleveland',
'RUT' => 'Rutland',
'SHR' => 'Shropshire',
'SLG' => 'Slough',
'SGC' => 'South Gloucestershire',
'STH' => 'Southampton',
'SOS' => 'Southend-on-Sea',
'STT' => 'Stockton-on-Tees',
'STE' => 'Stoke-on-Trent',
'SWD' => 'Swindon',
'TFW' => 'Telford and Wrekin',
'THR' => 'Thurrock',
'TOB' => 'Torbay',
'WRT' => 'Warrington',
'WBK' => 'West Berkshire',
'WIL' => 'Wiltshire',
'WNM' => 'Windsor and Maidenhead',
'WOK' => 'Wokingham',
'YOR' => 'York',
'ANN' => 'Antrim and Newtownabbey',
'AND' => 'Ards and North Down',
'ABC' => 'Armagh, Banbridge and Craigavon',
'BFS' => 'Belfast',
'CCG' => 'Causeway Coast and Glens',
'DRS' => 'Derry and Strabane',
'FMO' => 'Fermanagh and Omagh',
'LBC' => 'Lisburn and Castlereagh',
'MEA' => 'Mid and East Antrim',
'MUL' => 'Mid Ulster',
'NMD' => 'Newry, Mourne and Down',
'ABE' => 'Aberdeen City',
'ABD' => 'Aberdeenshire',
'ANS' => 'Angus',
'AGB' => 'Argyll and Bute',
'CLK' => 'Clackmannanshire',
'DGY' => 'Dumfries and Galloway',
'DND' => 'Dundee City',
'EAY' => 'East Ayrshire',
'EDU' => 'East Dunbartonshire',
'ELN' => 'East Lothian',
'ERW' => 'East Renfrewshire',
'EDH' => 'Edinburgh, City of',
'ELS' => 'Eilean Siar',
'FAL' => 'Falkirk',
'FIF' => 'Fife',
'GLG' => 'Glasgow City',
'HLD' => 'Highland',
'IVC' => 'Inverclyde',
'MLN' => 'Midlothian',
'MRY' => 'Moray',
'NAY' => 'North Ayrshire',
'NLK' => 'North Lanarkshire',
'ORK' => 'Orkney Islands',
'PKN' => 'Perth and Kinross',
'RFW' => 'Renfrewshire',
'SCB' => 'Scottish Borders, The',
'ZET' => 'Shetland Islands',
'SAY' => 'South Ayrshire',
'SLK' => 'South Lanarkshire',
'STG' => 'Stirling',
'WDU' => 'West Dunbartonshire',
'WLN' => 'West Lothian',
'BGW' => 'Blaenau Gwent',
'BGE' => 'Bridgend [Pen-y-bont ar Ogwr GB-POG]',
'CAY' => 'Caerphilly [Caerffili GB-CAF]',
'CRF' => 'Cardiff [Caerdydd GB-CRD]',
'CMN' => 'Carmarthenshire [Sir Gaerfyrddin GB-GFY]',
'CGN' => 'Ceredigion [Sir Ceredigion]',
'CWY' => 'Conwy',
'DEN' => 'Denbighshire [Sir Ddinbych GB-DDB]',
'FLN' => 'Flintshire [Sir y Fflint GB-FFL]',
'GWN' => 'Gwynedd',
'AGY' => 'Isle of Anglesey [Sir Ynys Môn GB-YNM]',
'MTY' => 'Merthyr Tydfil [Merthyr Tudful GB-MTU]',
'MON' => 'Monmouthshire [Sir Fynwy GB-FYN]',
'NTL' => 'Neath Port Talbot [Castell-nedd Port Talbot GB-CTL]',
'NWP' => 'Newport [Casnewydd GB-CNW]',
'PEM' => 'Pembrokeshire [Sir Benfro GB-BNF]',
'POW' => 'Powys',
'RCT' => 'Rhondda, Cynon, Taff [Rhondda, Cynon, Taf]',
'SWA' => 'Swansea [Abertawe GB-ATA]',
'TOF' => 'Torfaen [Tor-faen]',
'VGL' => 'Vale of Glamorgan, The [Bro Morgannwg GB-BMG]',
'WRX' => 'Wrexham [Wrecsam GB-WRC]'
);
/**
* List of CA states as 2-letter code => name pairs
*
* @var array
*/
protected static $ca_states_array = array(
'AB' => 'Alberta',
'BC' => 'British Columbia',
'MB' => 'Manitoba',
'NB' => 'New Brunswick',
'NL' => 'Newfoundland and Labrador',
'NS' => 'Nova Scotia',
'ON' => 'Ontario',
'PE' => 'Prince Edward Island',
'QC' => 'Quebec',
'SK' => 'Saskatchewan',
'NT' => 'Northwest Territories',
'NU' => 'Nunavut',
'YT' => 'Yukon'
);
protected static $ir_states_array = array (
'32' => 'Alborz',
'03' => 'Ardabīl',
'02' => 'Āz̄arbāyjān-e Gharbī',
'01' => 'Āz̄arbāyjān-e Sharqī',
'06' => 'Būshehr',
'08' => 'Chahār Maḩāl va Bakhtīārī',
'04' => 'Eşfahān',
'14' => 'Fārs',
'19' => 'Gīlān',
'27' => 'Golestān',
'24' => 'Hamadān',
'23' => 'Hormozgān',
'05' => 'Īlām',
'15' => 'Kermān',
'17' => 'Kermānshāh',
'29' => 'Khorāsān-e Jonūbī',
'30' => 'Khorāsān-e Raẕavī',
'31' => 'Khorāsān-e Shomālī',
'10' => 'Khūzestān',
'18' => 'Kohgīlūyeh va Bowyer Aḩmad',
'16' => 'Kordestān',
'20' => 'Lorestān',
'22' => 'Markazī',
'21' => 'Māzandarān',
'28' => 'Qazvīn',
'26' => 'Qom',
'12' => 'Semnān',
'13' => 'Sīstān va Balūchestān',
'07' => 'Tehrān',
'25' => 'Yazd',
'11' => 'Zanjān'
);
/**
* Get list of US states
* @param string $country = de selected country code to fetch its states
@ -440,6 +719,12 @@ class Country
return self::$at_states_array;
case 'ch':
return self::$ch_states_array;
case 'ca':
return self::$ca_states_array;
case 'gb':
return self::$gb_states_array;
case 'ir':
return self::$ir_states_array;
}
}