2017 © Pedro Peláez
 

library countrynames

A PHP library to work with localized country names

image

mlocati/countrynames

A PHP library to work with localized country names

  • Monday, November 21, 2016
  • by mlocati
  • Repository
  • 1 Watchers
  • 2 Stars
  • 40 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

PHP library to recognize localized country names thanks to Unicode CLDR

Features

  • Understand a lot of languages (almost 150 - but some language may not be complete).
  • Works with PHP 5.3+
  • Requires the mb_string PHP extension (or any package that implements mb_strtolower for UTF-8)

Install

With composer

composer require mlocati/countrynames, (*1)

Without composer

<?php

require_once 'autoload.php';

Sample usage


use MLocati\CountryNames\CountryList; require_once 'autoload.php'; // Not required if you use composer $italianList = new CountryList('it'); $italianCountry = $italianList->getCountryByName('italia'); $englishList = new CountryList('en'); $englishCountry = $englishList->getCountryByCode($italianCountry->getCode()); echo $englishCountry->getCanonicalName(); // Dumps 'Italy'

The Versions

21/11 2016

dev-master

9999999-dev https://github.com/mlocati/countrynames

A PHP library to work with localized country names

  Sources   Download

MIT

The Requires

  • php >=5.3

 

country countries localized

21/11 2016

1.0.0

1.0.0.0 https://github.com/mlocati/countrynames

A PHP library to work with localized country names

  Sources   Download

MIT

The Requires

  • php >=5.3

 

country countries localized