定制 chibifr/country-converter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

chibifr/country-converter

最新稳定版本:1.0.0

Composer 安装命令:

composer require chibifr/country-converter

包简介

A PHP package to convert a country ISO to country name and vice-versa.

README 文档

README

A PHP package to convert a country ISO to country name and vice-versa.

Installation

To install this package, make sure you have composer. Then, require it:

composer require chibifr/country-converter

Usage

You can now use it really easily! After you required the package with composer, start using it:

Without Exception management

<?php
// Require the composer's vendor autoload file
require './vendor/autoload.php';

use ChibiFR\CountryConverter\Converter;

// Create a new Converter object
$converter = new Converter();

// Get a country name from its ISO code
echo $converter->getCountryName('jp'); // will echo "Japan"

// Get a country ISO code from its name
echo $converter->getCountryCode('France'); // will echo "FR"

With Exception management

<?php
// Require the composer's vendor autoload file
require './vendor/autoload.php';

use ChibiFR\CountryConverter\Converter;

// Create a new Converter object
$converter = new Converter();

// Get a country name from its ISO code
try {
    echo $converter->getCountryName('jp'); // will echo "Japan"
} catch (InvalidCountryNameException $e) {
    die($e->getMessage());
}

// Get a country ISO code from its name
try {
    echo $converter->getCountryCode('France'); // will echo "FR"
} catch (InvalidCountryCodeException $e) {
    die($e->getMessage());
}

统计信息

  • 总下载量: 3.63k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固