Download the PHP package stefangabos/world_countries without Composer

On this page you can find all versions of the php package stefangabos/world_countries. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package world_countries

zebrajs

World countries  Tweet

available in multiple languages, in CSV, JSON, PHP, SQL and XML formats, with associated codes as defined by the ISO 3166 standard, and with national flags included; also available are the ISO 3166-2 codes used for identifying the principal subdivisions (e.g., provinces or states) of all countries coded in ISO 3166-1

npm Total Monthly JSDelivr License

Constantly updated lists of world countries, territories and areas of geographical interest, with associated alpha-2, alpha-3 and numeric codes as defined by the ISO 3166-1 standard, published and maintained by the International Organization for Standardization, available in CSV, JSON, PHP, SQL and XML formats, in multiple languages and with national flags included. Also available are the ISO 3166-2 codes used for identifying the principal subdivisions (e.g., provinces or states) of all countries coded in ISO 3166-1.

In the language folders (inside data/countries) you will find files named in two different ways.
Here's what you will find in each of them:

File names Content
*world.** Files named like this contain all the 249 countries, territories, and areas of geographical interest that have an officially assigned ISO 3166-1 code.
*countries.** Files named like this contain the 193 sovereign states (commonly referred to as countries) that are members of the United Nations (UN) .

Note that there are 206 sovereign states in the world, the 11 states that are missing from the countries list being the ones having their sovereignty disputed. See the list of sovereign states with information on their status and recognition of their sovereignty.

The files contain:

1 for other languages the country names are in that particular language
2 ISO 3166-1 alpha codes are uppercase but this library provides them in lowercase

The lists are currently available in 35 languages:

The language folders are named based on the ISO 639-1 standard.

ISO 3166-2 codes

The project also tries to be a comprehensive and up-to-date source for ISO 3166-2 which defines codes for identifying the principal subdivisions (e.g., provinces or states) of all countries coded in ISO 3166-1.

The purpose of ISO 3166-2 is to establish an international standard of short and unique alphanumeric codes to represent the relevant administrative divisions and dependent territories of all countries in a more convenient and less ambiguous form than their full names. Each complete ISO 3166-2 code consists of two parts, separated by a hyphen:

US-TX for Texas, USA

The first part is the ISO 3166-1 alpha-2 code of the country; The second part is a string of up to three alphanumeric characters, which is usually obtained from national sources and stems from coding systems already in use in the country concerned, but may also be developed by the ISO itself. Each complete ISO 3166-2 code can then be used to uniquely identify a country subdivision in a global context.

The list is available in CSV, JSON, PHP, SQL and XML formats in the data/subdivisions folder and the CSV one looks like this:

The starting point of this list was the ISO 3166-2 Subdivision Code list provided by IP2Location but this one will be maintained by the community.

🎂 Support the development of this project

Your support means a lot and it keeps me motivated to keep working on open source projects.
If you like this project please ⭐ it by clicking on the star button at the top of the page.
If you are feeling generous, you can buy me a coffee by donating through PayPal, or you can become a sponsor.
Either way - Thank you! 🎉

Star it on GitHub Donate

Installation

The lists are available as a npm package. To install it use:

You can install the lists via Composer

Alternatively, you can load data from JSDelivr CDN like this:

Or

download a customized build.

Data formats

SQL

Excerpt from the data/countries/en/countries.sql file:

CSV

Excerpt from the data/countries/en/countries.csv file:

JSON

Excerpt from the data/countries/en/countries.json file:

Here's a little helper function for searching for a specific country's data

The helper function assumes that the JSON with the countries data is associated with a variable named countries which is in the same scope as the function

The helper function is to be used with the non-combined data sets.
For the combined data sets you can write the function yourself.

Usage

TypeScript

Typings are available (source):

PHP

Excerpt from the data/countries/en/countries.php file:

Here's a little helper function for searching for a specific country's data

The helper function is to be used with the non-combined data sets.
For the combined data sets you can write the function yourself.

Usage

XML

Excerpt from the data/countries/en/countries.xml file:

Flags

The package also contains the national flags of each country as a 16x16, 24x24, 32x32, 48x48, 64x64 and 128x128 PNG images. The image files are named using the ISO 3166-1-alpha-2 code of the country they represent, for easily pairing flags with countries.

Flag images are also available as single JSON files, one for each of the available sizes, containing all flag images as data-uri

Data sources

Country names in all languages are taken from Wikipedia.


All versions of world_countries with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stefangabos/world_countries contains the following files

Loading the files please wait ....