Skip to content

Instantly share code, notes, and snippets.

@gonzam88
Last active July 23, 2024 14:48
Show Gist options
  • Save gonzam88/c275e0e131a10032ac77ef2b31b28ed3 to your computer and use it in GitHub Desktop.
Save gonzam88/c275e0e131a10032ac77ef2b31b28ed3 to your computer and use it in GitHub Desktop.
<?php
$paises = array("Afganistán","Albania","Alemania","Andorra","Angola","Antigua y Barbuda","Arabia Saudita","Argelia","Argentina","Armenia","Australia","Austria","Azerbaiyán","Bahamas","Bangladés","Barbados","Baréin","Bélgica","Belice","Benín","Bielorrusia","Birmania","Bolivia","Bosnia y Herzegovina","Botsuana","Brasil","Brunéi","Bulgaria","Burkina Faso","Burundi","Bután","Cabo Verde","Camboya","Camerún","Canadá","Catar","Chad","Chile","China","Chipre","Ciudad del Vaticano","Colombia","Comoras","Corea del Norte","Corea del Sur","Costa de Marfil","Costa Rica","Croacia","Cuba","Dinamarca","Dominica","Ecuador","Egipto","El Salvador","Emiratos Árabes Unidos","Eritrea","Eslovaquia","Eslovenia","España","Estados Unidos","Estonia","Etiopía","Filipinas","Finlandia","Fiyi","Francia","Gabón","Gambia","Georgia","Ghana","Granada","Grecia","Guatemala","Guyana","Guinea","Guinea ecuatorial","Guinea-Bisáu","Haití","Honduras","Hungría","India","Indonesia","Irak","Irán","Irlanda","Islandia","Islas Marshall","Islas Salomón","Israel","Italia","Jamaica","Japón","Jordania","Kazajistán","Kenia","Kirguistán","Kiribati","Kuwait","Laos","Lesoto","Letonia","Líbano","Liberia","Libia","Liechtenstein","Lituania","Luxemburgo","Madagascar","Malasia","Malaui","Maldivas","Malí","Malta","Marruecos","Mauricio","Mauritania","México","Micronesia","Moldavia","Mónaco","Mongolia","Montenegro","Mozambique","Namibia","Nauru","Nepal","Nicaragua","Níger","Nigeria","Noruega","Nueva Zelanda","Omán","Países Bajos","Pakistán","Palaos","Palestina","Panamá","Papúa Nueva Guinea","Paraguay","Perú","Polonia","Portugal","Reino Unido","República Centroafricana","República Checa","República de Macedonia","República del Congo","República Democrática del Congo","República Dominicana","República Sudafricana","Ruanda","Rumanía","Rusia","Samoa","San Cristóbal y Nieves","San Marino","San Vicente y las Granadinas","Santa Lucía","Santo Tomé y Príncipe","Senegal","Serbia","Seychelles","Sierra Leona","Singapur","Siria","Somalia","Sri Lanka","Suazilandia","Sudán","Sudán del Sur","Suecia","Suiza","Surinam","Tailandia","Tanzania","Tayikistán","Timor Oriental","Togo","Tonga","Trinidad y Tobago","Túnez","Turkmenistán","Turquía","Tuvalu","Ucrania","Uganda","Uruguay","Uzbekistán","Vanuatu","Venezuela","Vietnam","Yemen","Yibuti","Zambia","Zimbabue");
?>
@jeissonvalde
Copy link

Jejeje

@gerardodinardo
Copy link

Grande.

@damian-dif
Copy link

Genial!!! muchas gracias!!!

@n0rb3r7
Copy link

n0rb3r7 commented Aug 24, 2021

Super!

@nr1q
Copy link

nr1q commented Oct 28, 2021

Si alguien los necesita con codigo ISO de 3 letras en array asociativo, aquí lo dejo:

<?php

$paises = ["AFG" => "Afganistán", "ALB" => "Albania", "DEU" => "Alemania", "AND" => "Andorra", "AGO" => "Angola", "ATG" => "Antigua y Barbuda", "SAU" => "Arabia Saudita", "DZA" => "Argelia", "ARG" => "Argentina", "ARM" => "Armenia", "AUS" => "Australia", "AUT" => "Austria", "AZE" => "Azerbaiyán", "BHS" => "Bahamas", "BGD" => "Bangladés", "BRB" => "Barbados", "BHR" => "Baréin", "BEL" => "Bélgica", "BLZ" => "Belice", "BEN" => "Benín", "BLR" => "Bielorrusia", "MMR" => "Birmania", "BOL" => "Bolivia", "BIH" => "Bosnia y Herzegovina", "BWA" => "Botsuana", "BRA" => "Brasil", "BRN" => "Brunéi", "BGR" => "Bulgaria", "BFA" => "Burkina Faso", "BDI" => "Burundi", "BTN" => "Bután", "CPV" => "Cabo Verde", "KHM" => "Camboya", "CMR" => "Camerún", "CAN" => "Canadá", "QAT" => "Catar", "TCD" => "Chad", "CHL" => "Chile", "CHN" => "China", "CYP" => "Chipre", "VAT" => "Ciudad del Vaticano", "COL" => "Colombia", "COM" => "Comoras", "PRK" => "Corea del Norte", "KOR" => "Corea del Sur", "CIV" => "Costa de Marfil", "CRI" => "Costa Rica", "HRV" => "Croacia", "CUB" => "Cuba", "DNK" => "Dinamarca", "DMA" => "Dominica", "ECU" => "Ecuador", "EGY" => "Egipto", "SLV" => "El Salvador", "ARE" => "Emiratos Árabes Unidos", "ERI" => "Eritrea", "SVK" => "Eslovaquia", "SVN" => "Eslovenia", "ESP" => "España", "USA" => "Estados Unidos", "EST" => "Estonia", "ETH" => "Etiopía", "PHL" => "Filipinas", "FIN" => "Finlandia", "FJI" => "Fiyi", "FRA" => "Francia", "GAB" => "Gabón", "GMB" => "Gambia", "GEO" => "Georgia", "GHA" => "Ghana", "GRD" => "Granada", "GRC" => "Grecia", "GTM" => "Guatemala", "GUY" => "Guyana", "GIN" => "Guinea", "GNQ" => "Guinea Ecuatorial", "GNB" => "Guinea-Bisáu", "HTI" => "Haití", "HND" => "Honduras", "HUN" => "Hungría", "IND" => "India", "IDN" => "Indonesia", "IRQ" => "Irak", "IRN" => "Irán", "IRL" => "Irlanda", "ISL" => "Islandia", "MHL" => "Islas Marshall", "SLB" => "Islas Salomón", "ISR" => "Israel", "ITA" => "Italia", "JAM" => "Jamaica", "JPN" => "Japón", "JOR" => "Jordania", "KAZ" => "Kazajistán", "KEN" => "Kenia", "KGZ" => "Kirguistán", "KIR" => "Kiribati", "KWT" => "Kuwait", "LAO" => "Laos", "LSO" => "Lesoto", "LVA" => "Letonia", "LBN" => "Líbano", "LBR" => "Liberia", "LBY" => "Libia", "LIE" => "Liechtenstein", "LTU" => "Lituania", "LUX" => "Luxemburgo", "MDG" => "Madagascar", "MYS" => "Malasia", "MWI" => "Malaui", "MDV" => "Maldivas", "MLI" => "Malí", "MLT" => "Malta", "MAR" => "Marruecos", "MUS" => "Mauricio", "MRT" => "Mauritania", "MEX" => "México", "FSM" => "Micronesia", "MDA" => "Moldavia", "MCO" => "Mónaco", "MNG" => "Mongolia", "MNE" => "Montenegro", "MOZ" => "Mozambique", "NAM" => "Namibia", "NRU" => "Nauru", "NPL" => "Nepal", "NIC" => "Nicaragua", "NER" => "Níger", "NGA" => "Nigeria", "NOR" => "Noruega", "NZL" => "Nueva Zelanda", "OMN" => "Omán", "NLD" => "Países Bajos", "PAK" => "Pakistán", "PLW" => "Palaos", "PSE" => "Palestina", "PAN" => "Panamá", "PNG" => "Papúa Nueva Guinea", "PRY" => "Paraguay", "PER" => "Perú", "POL" => "Polonia", "PRT" => "Portugal", "GBR" => "Reino Unido", "CAF" => "República Centroafricana", "CZE" => "República Checa", "MKD" => "República de Macedonia", "COG" => "República del Congo", "COD" => "República Democrática del Congo", "DOM" => "República Dominicana", "ZAF" => "República Sudafricana", "RWA" => "Ruanda", "ROU" => "Rumanía", "RUS" => "Rusia", "WSM" => "Samoa", "KNA" => "San Cristóbal y Nieves", "SMR" => "San Marino", "VCT" => "San Vicente y las Granadinas", "LCA" => "Santa Lucía", "STP" => "Santo Tomé y Príncipe", "SEN" => "Senegal", "SRB" => "Serbia", "SYC" => "Seychelles", "SLE" => "Sierra Leona", "SGP" => "Singapur", "SYR" => "Siria", "SOM" => "Somalia", "LKA" => "Sri Lanka", "SWZ" => "Suazilandia", "SDN" => "Sudán", "SSD" => "Sudán del Sur", "SWE" => "Suecia", "CHE" => "Suiza", "SUR" => "Surinam", "THA" => "Tailandia", "TZA" => "Tanzania", "TJK" => "Tayikistán", "TLS" => "Timor Oriental", "TGO" => "Togo", "TON" => "Tonga", "TTO" => "Trinidad y Tobago", "TUN" => "Túnez", "TKM" => "Turkmenistán", "TUR" => "Turquía", "TUV" => "Tuvalu", "UKR" => "Ucrania", "UGA" => "Uganda", "URY" => "Uruguay", "UZB" => "Uzbekistán", "VUT" => "Vanuatu", "VEN" => "Venezuela", "VNM" => "Vietnam", "YEM" => "Yemen", "DJI" => "Yibuti", "ZMB" => "Zambia", "ZWE" => "Zimbabue"];

?>

@matezito
Copy link

Muchas gracias!

@pathros
Copy link

pathros commented May 31, 2022

¿Alguien puede compartir su lista de países con código de dos letras y nacionalidad asociada?

@StivelxDev
Copy link

Muchas gracias! 😁

@engomez2730
Copy link

Thanks man! 🙌

@nr1q
Copy link

nr1q commented Dec 12, 2023

Por acá dejo los mismos países pero con código ISO de dos letras:

<?php

$paises = [ "AF" => "Afganistán", "AL" => "Albania", "DE" => "Alemania", "AD" => "Andorra", "AO" => "Angola", "AG" => "Antigua y Barbuda", "SA" => "Arabia Saudita", "DZ" => "Argelia", "AR" => "Argentina", "AM" => "Armenia", "AU" => "Australia", "AT" => "Austria", "AZ" => "Azerbaiyán", "BS" => "Bahamas", "BD" => "Bangladés", "BB" => "Barbados", "BH" => "Baréin", "BE" => "Bélgica", "BZ" => "Belice", "BJ" => "Benín", "BY" => "Bielorrusia", "BO" => "Bolivia", "BA" => "Bosnia y Herzegovina", "BW" => "Botsuana", "BR" => "Brasil", "BN" => "Brunéi", "BG" => "Bulgaria", "BF" => "Burkina Faso", "BI" => "Burundi", "BT" => "Bután", "CV" => "Cabo Verde", "KH" => "Camboya", "CM" => "Camerún", "CA" => "Canadá", "QA" => "Catar", "TD" => "Chad", "CL" => "Chile", "CN" => "China", "CY" => "Chipre", "VA" => "Ciudad del Vaticano", "CO" => "Colombia", "KM" => "Comoras", "KP" => "Corea del Norte", "KR" => "Corea del Sur", "CI" => "Costa de Marfil", "CR" => "Costa Rica", "HR" => "Croacia", "CU" => "Cuba", "DK" => "Dinamarca", "DM" => "Dominica", "EC" => "Ecuador", "EG" => "Egipto", "SV" => "El Salvador", "AE" => "Emiratos Árabes Unidos", "ER" => "Eritrea", "SK" => "Eslovaquia", "SI" => "Eslovenia", "ES" => "España", "US" => "Estados Unidos", "EE" => "Estonia", "ET" => "Etiopía", "PH" => "Filipinas", "FI" => "Finlandia", "FJ" => "Fiyi", "FR" => "Francia", "GA" => "Gabón", "GM" => "Gambia", "GE" => "Georgia", "GH" => "Ghana", "GD" => "Granada", "GR" => "Grecia", "GT" => "Guatemala", "GY" => "Guyana", "GN" => "Guinea", "GQ" => "Guinea Ecuatorial", "GW" => "Guinea-Bisáu", "HT" => "Haití", "HN" => "Honduras", "HU" => "Hungría", "IN" => "India", "ID" => "Indonesia", "IQ" => "Irak", "IR" => "Irán", "IE" => "Irlanda", "IS" => "Islandia", "MH" => "Islas Marshall", "SB" => "Islas Salomón", "IL" => "Israel", "IT" => "Italia", "JM" => "Jamaica", "JP" => "Japón", "JO" => "Jordania", "KZ" => "Kazajistán", "KE" => "Kenia", "KG" => "Kirguistán", "KI" => "Kiribati", "KW" => "Kuwait", "LA" => "Laos", "LS" => "Lesoto", "LV" => "Letonia", "LB" => "Líbano", "LR" => "Liberia", "LY" => "Libia", "LI" => "Liechtenstein", "LT" => "Lituania", "LU" => "Luxemburgo", "MG" => "Madagascar", "MY" => "Malasia", "MW" => "Malaui", "MV" => "Maldivas", "ML" => "Malí", "MT" => "Malta", "MA" => "Marruecos", "MU" => "Mauricio", "MR" => "Mauritania", "MX" => "México", "FM" => "Micronesia", "MD" => "Moldavia", "MC" => "Mónaco", "MN" => "Mongolia", "ME" => "Montenegro", "MZ" => "Mozambique", "MM" => "Myanmar", "NA" => "Namibia", "NR" => "Nauru", "NP" => "Nepal", "NI" => "Nicaragua", "NE" => "Níger", "NG" => "Nigeria", "NO" => "Noruega", "NZ" => "Nueva Zelanda", "OM" => "Omán", "NL" => "Países Bajos", "PK" => "Pakistán", "PW" => "Palaos", "PS" => "Palestina", "PA" => "Panamá", "PG" => "Papúa Nueva Guinea", "PY" => "Paraguay", "PE" => "Perú", "PL" => "Polonia", "PT" => "Portugal", "GB" => "Reino Unido", "CF" => "República Centroafricana", "CZ" => "República Checa", "MK" => "República de Macedonia", "CG" => "República del Congo", "CD" => "República Democrática del Congo", "DO" => "República Dominicana", "ZA" => "República Sudafricana", "RW" => "Ruanda", "RO" => "Rumanía", "RU" => "Rusia", "WS" => "Samoa", "KN" => "San Cristóbal y Nieves", "SM" => "San Marino", "VC" => "San Vicente y las Granadinas", "LC" => "Santa Lucía", "ST" => "Santo Tomé y Príncipe", "SN" => "Senegal", "RS" => "Serbia", "SC" => "Seychelles", "SL" => "Sierra Leona", "SG" => "Singapur", "SY" => "Siria", "SO" => "Somalia", "LK" => "Sri Lanka", "SZ" => "Suazilandia", "SD" => "Sudán", "SS" => "Sudán del Sur", "SE" => "Suecia", "CH" => "Suiza", "SR" => "Surinam", "TH" => "Tailandia", "TZ" => "Tanzania", "TJ" => "Tayikistán", "TL" => "Timor Oriental", "TG" => "Togo", "TO" => "Tonga", "TT" => "Trinidad y Tobago", "TN" => "Túnez", "TM" => "Turkmenistán", "TR" => "Turquía", "TV" => "Tuvalu", "UA" => "Ucrania", "UG" => "Uganda", "UY" => "Uruguay", "UZ" => "Uzbekistán", "VU" => "Vanuatu", "VE" => "Venezuela", "VN" => "Vietnam", "YE" => "Yemen", "DJ" => "Yibuti", "ZM" => "Zambia", "ZW" => "Zimbabue" ];

?>

@cuellar037
Copy link

Gracias @nr1q , me ahorraste un resto de trabajo bro, saludos ✌️

@matiazar
Copy link

matiazar commented Jul 7, 2024

gracias!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment