PHP code example of ageekdev / myanmar-name-converter

1. Go to this page and download the library: Download ageekdev/myanmar-name-converter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ageekdev / myanmar-name-converter example snippets


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); // ထွန်းထွန်း

use \AgeekDev\MMName\Facades\MMName;

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

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

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

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