PHP Classes

PHP Countries List Array: Get names and codes of all world countries

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 488 All time: 5,873 This week: 65Up
Version License PHP version Categories
php-countries-array 1.0.8GNU General Publi...5.3.0PHP 5, Statistics, Geography


This class can get the names and codes of all world countries.

It contains an array with the list of all countries with their properties like names, continent, ISO 3166 2 or 3 letter country codes, ISD codes for making phone calls.

The class can get the whole array of countries or a given country by one of the stored properties.

Picture of sameer shelavale
  Performance   Level  
Name: sameer shelavale is available for providing paid consulting. Contact sameer shelavale .
Classes: 5 packages by
Country: India India
Age: 42
All time rank: 137276 in India India
Week rank: 180 Up17 in India India Up
Innovation award
Innovation award
Nominee: 1x


 * Created by PhpStorm.
 * User: sam
 * Date: 12/15/14
 * Time: 8:50 PM
use SameerShelavale\PhpCountriesArray\CountriesArray;
"../src/CountriesArray.php" );

$countries = CountriesArray::get();
var_dump( $countries );

$countries = CountriesArray::get2d( 'alpha3' );
var_dump( $countries );

$countries = CountriesArray::get2d( 'alpha3', array( 'name', 'isd', 'continent' ) );
var_dump( $countries );

$countries = CountriesArray::get2d( null, array( 'name', 'num', 'isd', 'continent' ) );
var_dump( $countries );

  Files folder image Files  
File Role Description
Files folder imagesample (1 file)
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  sample  
File Role Description
  Accessible without login Plain text file sample1.php Example Example script

  Files folder image Files  /  src  
File Role Description
  Plain text file CountriesArray.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:5,873
This week:65Up