Skip to content

ageekdev/myanmar-name-converter

Repository files navigation

Myanmar Name Converter

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Convert Myanmar Name to English, and vice versa.

Installation

You can install the package via composer:

composer require ageekdev/myanmar-name-converter

Usage

Convert Names

use \AgeekDev\MMName\Facades\MMName;

// From Myanmar Name To Myan-glish

$name = "ကိုကျော်";

MMName::convertToEn($name); // Ko Kyaw

MMName::convertToEn($name, isUcWords: false); // ko kyaw

// From Myan-glish Name To Myanmar

$name = "Tun Tun";

MMName::convertToMm($name); // ထွန်းထွန်း

// With Helper Function

$name = "ကိုကျော်";

mm_name_to_en($name); // Ko Kyaw

$name = "Tun Tun";

en_name_to_mm($name); // ထွန်းထွန်း

Compare Names

use \AgeekDev\MMName\Facades\MMName;

MMName::compare('khaing', 'khine'); // true

MMName::compare('သီဟကျော်', 'thi ha kyaw'); // true

// With Helper Function
compare_names('khaing', 'khine'); // true

Checking Names

use \AgeekDev\MMName\Facades\MMName;

MMName::isEnName('Thiha'); // true

MMName::isEnName('သီဟ'); // false

MMName::isMmName('သီဟ'); // true

MMName::isMmName('Thiha'); // false

// With Helper Function
is_en_name('Thiha'); // true

is_mm_name('သီဟ'); // true

Testing

You can run the tests with:

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.