phyozawtun/composer-myanmar-national-registration-nrc-card
Composer 安装命令:
composer require phyozawtun/composer-myanmar-national-registration-nrc-card
包简介
PHP Composer Package - Myanmar National Registration Card. in from NRC card. General purpose library for Myanmar NRC Card. Get list of townships code used in NRC number format, validation NRC number inputs and intigrated in forms.
README 文档
README
PHP Composer Package - Myanmar National Registration Card. in from NRC card. General purpose library for Myanmar NRC Card. Get list of townships code used in NRC number format, validation NRC number inputs and intigrated in forms. For full documentation pleser refer to DOCUMENTATION.md
- Special Thanks
- Installation
- Roadmap
- Contribution
- Usage
Special Thanks
Htet Oo Zin / Myanmar NRC https://github.com/htetoozin/Myanmar-NRC
Installation
composer install
Roadmap
- VanillaJS Library Myanmar National Registration Card
- JavaScript, Node.js Package
I am planning to release next two news release. Please join and congribute in this repository.
Contributing
Interested in contributing to Architect? I would love your help. PHP Composer Package - Myanmar National Registration Card is an open source project, built one contribution at a time by users like you.
Usage
getNRC
Example #1 Get all states and states' disticts short codes
<?php
$array = getNRC();
var_dump($array);
?>
The above example will output:
array(2) {
[0]=>
array(9) {
[0]=>
array(4) {
["distict_id"]=>
string(2) "24"
["township_en"]=>
string(7) "BaLaKha"
["township_mm"]=>
string(33) "(ဘလခ) ဘော်လခဲ"
["state_id"]=>
string(1) "2"
}
...
Example #2 Filter single or multiple states and states' disticts short codes
<?php
$array1 = getNRC(12);
var_dump($array1); // Output disticts with state_id 12 only
$array2 = getNRC([12,6,7]); // Output disticts with state_id 12, 6 and 7 only
var_dump($array2);
?>
isNRC
Example #1 Simple vaid and invalid examples
<?php
// This output will be valid
$state_id = 12;
$distict = "BaTaHta";
$reg_no = 010203;
$is_valid = isNRC($state_id,$distict,$reg_no,$lang);
var_dump($is_valid);
// This output will be invalid
$lang = "mm";
$is_valid = isNRC($state_id,$distict,$reg_no,$lang);
var_dump($is_valid);
?>
The above example will output:
true
false
Example #2 Commoon invalid examples comparing with valid examples
// Simple check with English Charaictes
$is_valid = isNRC("12","BaTaHta","010203");
var_dump($is_valid);
// Simple check with English Charaictes
$is_valid = isNRC("12","LaMaNa","010203","en");
var_dump($is_valid);
// Mixup Myannar and English numeric charaictes check
$is_valid = isNRC("12","ဗတထ","010203","mm");
var_dump($is_valid);
// Can mixup Myannar and English numeric charaictes
$is_valid = isNRC("12","BaTaHta",'၀၁၀၂၀၃','any');
var_dump($is_valid);
// Can mixup Myanamr and English charaictes for numeric string where lang is en or mm
$is_valid = isNRC("12","လမန",'၀၁၀၂၀၃',"mm");
var_dump($is_valid);
// Defined language and input must be relevent
$lang = "en";
$is_valid = isNRC($state_id,$distict,$reg_no,$lang);
var_dump($is_valid);
// Township codes and state_id must be relative
$is_valid = isNRC("6","BaTaHta",010203);
var_dump($is_valid);
// Reg no mush be 6 digit
$is_valid = isNRC("6","BaTaHta",001002003);
var_dump($is_valid);
The above example will output:
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(false)
bool(false)
bool(false)
Notes
Note: More examples available in
repository/examples/directory. These examples also available on web demo.
Note: For full documentation pleser refer to DOCUMENTATION.md
phyozawtun/composer-myanmar-national-registration-nrc-card 适用场景与选型建议
phyozawtun/composer-myanmar-national-registration-nrc-card 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15 次下载、GitHub Stars 达 3, 最近一次更新时间为 2021 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 phyozawtun/composer-myanmar-national-registration-nrc-card 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phyozawtun/composer-myanmar-national-registration-nrc-card 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0-or-later
- 更新时间: 2021-04-08