Giter Site home page Giter Site logo

zhooravell / php-iso-3166-1 Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 8.0 49 KB

ISO 3166-1 php helper

Home Page: https://zhooravell.github.io/php-iso-3166-1/

License: MIT License

PHP 100.00%
php iso-3166-1 iso-3166-1-alpha-3 iso-3166-1-alpha-2 iso-3166-1-numeric country-codes

php-iso-3166-1's Introduction

PHP ISO-3166-1 library

A PHP library providing ISO 3166-1 data.

Build Status codecov License

Installing

$ composer require zhuravel/php-iso-3166-1

Example #1

<?php
require 'vendor/autoload.php';

$canada1 = getTwoCharacterCountries()['CA'];
$canada2 = getThreeCharacterCountries()['CAN'];
$canada3 = getNumericCountryCodes()['124'];

var_dump($canada1, $canada2, $canada3);

Example #2

<?php
require 'vendor/autoload.php';

foreach (getTwoCharacterCountries() as $code => $name) {
    echo sprintf("%s %s\n", $code, $name);
}

Example #3

<?php
require 'vendor/autoload.php';

use Iso\Countries\Factory\ISO3166CountryFactory;

$factory = new ISO3166CountryFactory();

$canada = $factory->fromAlphaTwoCode('CA');

var_dump($canada);

Source(s)

php-iso-3166-1's People

Contributors

zhooravell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

php-iso-3166-1's Issues

autoload.php

hello, you have autoload.php in your sample test , but there is not autoload.php in your src

thank you

Consider dropping php-5.6 version support

As title, since the php-5.6 version support has been inactive, this PHP package should drop this version support.

And I also notice other PHP projects under this account have supported php-7.1 or php-7.2 version supports.

To be consistency for other PHP projects, it should be nice to let this require php-7.1 or php-7.2 version, too

Once @zhooravell accepts this issue, I'll be happy to work on this ๐Ÿ˜„.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.