承接 datablock/countrycodes 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

datablock/countrycodes

Composer 安装命令:

composer require datablock/countrycodes

包简介

Country codes and other info.

README 文档

README

Install

composer install datablock/countrycodes

Usage

New instance

new CountryCodes([?string $country=null]);

Parameters :

  • $country string to define a specific country.

Example :

use \Datablock\CountryCodes\CountryCodes;
// ...
$countrycodes = new CountryCodes();
$countrycodes = new CountryCodes('FR');

Set the country

Define or orverride the country definition :

$countrycodes->setCountry(string $country);

Parameters :

  • $country string (required) to define a specific country.
use \Datablock\CountryCodes\CountryCodes;
// ...
$countrycodes = new CountryCodes();
// ...
$countrycodes->setCountry('FR');

Database

Getting database as PHP array :

  • If the $country is not defined, getDatabase return the full database.
  • If the $country is defined, getDatabase return the database for the country.
$countrycodes->getDatabase([?string $country=null]);
  • getDatabase return data as PHP array.
  • getJsonDatabase return data as JSON file.

Parameters :

  • $country string to define a specific country.

Examples :

  • Example 1 (Full database) :

    use \Datablock\CountryCodes\CountryCodes;
    // ...
    $countrycodes = new CountryCodes();
    // ...
    $countrycodes->getDatabase();
  • Example 2 (Database for a specific country on instance) :

    use \Datablock\CountryCodes\CountryCodes;
    // ...
    $countrycodes = new CountryCodes('FR');
    // ...
    $countrycodes->getDatabase();
  • Example 3 (Database for a specific country after instance) :

    use \Datablock\CountryCodes\CountryCodes;
    // ...
    $countrycodes = new CountryCodes();
    // ...
    $countrycodes->setCountry('FR');
    // ...
    $countrycodes->getDatabase();
  • Example 4 (Database for a specific country only for the method) :

    use \Datablock\CountryCodes\CountryCodes;
    // ...
    $countrycodes = new CountryCodes();
    // ...
    $countrycodes->getDatabase('FR');

Get Country Name

  • If the $country is not defined, getCountryName return the associative array of ['country_code'] => "Country name".
  • If the $country is defined, getCountryName return the name of the country.
$countrycodes->getCountryName([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the code ISO Alpha 2

  • If the $country is not defined, getIso2 return the associative array of ['country_code'] => "Country ISO 2".
  • If the $country is defined, getIso2 return the code iso alpha 2 of the country.
$countrycodes->getIso2([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the code ISO Alpha 3

  • If the $country is not defined, getIso3 return the associative array of ['country_code'] => "Country ISO 3".
  • If the $country is defined, getIso3 return the code iso alpha 3 of the country.
$countrycodes->getIso3([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the TLD

  • If the $country is not defined, getTld return the associative array of ['country_code'] => "Country TLD".
  • If the $country is defined, getTld return the TLD of the country.
$countrycodes->getTld([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the code FIPS

  • If the $country is not defined, getFips return the associative array of ['country_code'] => "Country FIPS".
  • If the $country is defined, getFips return the code FIPS of the country.
$countrycodes->getFips([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the code ISO Numeric

  • If the $country is not defined, getIsoNumeric return the associative array of ['country_code'] => "Country ISO Numeric".
  • If the $country is defined, getIsoNumeric return the code iso numeric of the country.
$countrycodes->getIsoNumeric([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the geoname ID

  • If the $country is not defined, getGeonameId return the associative array of ['country_code'] => "Country Geoname ID".
  • If the $country is defined, getGeonameId return the geoname ID of the country.
$countrycodes->getGeonameId([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the E164

  • If the $country is not defined, getE164 return the associative array of ['country_code'] => "Country E164".
  • If the $country is defined, getE164 return the E164 of the country.
$countrycodes->getE164([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the PhoneCode

  • If the $country is not defined, getPhoneCode return the associative array of ['country_code'] => "Country PhoneCode".
  • If the $country is defined, getPhoneCode return the PhoneCode of the country.
$countrycodes->getPhoneCode([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the Continent

  • If the $country is not defined, getContinent return the associative array of ['country_code'] => "Country Continent".
  • If the $country is defined, getContinent return the Continent of the country.
$countrycodes->getContinent([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the Capital

  • If the $country is not defined, getCapital return the associative array of ['country_code'] => "Country Capital".
  • If the $country is defined, getCapital return the Capital of the country.
$countrycodes->getCapital([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the Timezone

  • If the $country is not defined, getTimezone return the associative array of ['country_code'] => "Country Timezone".
  • If the $country is defined, getTimezone return the Timezone of the country.
$countrycodes->getTimezone([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the Currency

  • If the $country is not defined, getCurrency return the associative array of ['country_code'] => "Country Currency".
  • If the $country is defined, getCurrency return the Currency of the country.
$countrycodes->getCurrency([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the LanguageCodes

  • If the $country is not defined, getLanguageCodes return the associative array of ['country_code'] => "Country LanguageCodes".
  • If the $country is defined, getCurrency return the LanguageCodes of the country.
$countrycodes->getLanguageCodes([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the Languages

  • If the $country is not defined, getLanguages return the associative array of ['country_code'] => "Country Languages".
  • If the $country is defined, getLanguages return the Languages of the country.
$countrycodes->getLanguages([?string $country=null]);

Parameters & Examples : same as getDatabase

Get the Area

  • If the $country is not defined, getArea return the associative array of ['country_code'] => "Country Area".
  • If the $country is defined, getArea return the Area of the country.
$countrycodes->getArea([?string $country=null]);

Parameters & Examples : same as getDatabase

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固