PHP code example of hakhant / convert-mm

1. Go to this page and download the library: Download hakhant/convert-mm 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/ */

    

hakhant / convert-mm example snippets



$number = '1234567';

$convert = Convert::mm($number);

return $convert;

// output 
'၁၂၃၄၅၆၇'


$today = '2023-08-07';

$convert = Convert::mmDate($today);

return $convert;

// output 
'၂၀၂၃ ခုနှစ်၊သြဂုတ်လ၊ ၀၇ ရက်'



$mmDateNumber = Convert::mmDateNumber('2023-08-07') 
// output '၂၀၂၃-၀၈-၀၇'

$year = Convert::year('2023') 
// output '၂၀၂၃'

$month = Convert::month('08') 
// output 'သြဂုတ်'

$day = Convert::day('8') 
// output '၈'



$regions = Convert::regions(); 
// return array of regions english format 

$mmRegions = Convert::mmRegions(); 
// return array of regions myanmar format

$citizens = Convert::citizens(); 
// return array of citizens 

$mmCitizens = Convert::mmCitizens(); 
// return array of citizens myanmar format

$townships = Convert::townships(); 
// return array of townships 

$mmTownships = Convert::mmTownships(); 
// return array of townships 

$number = Convert::nrcNumber('215556'); 
// return string '215556'

$mmNumber = Convert::mmNrcNumber('215556') 
// return string '၂၁၅၅၅၆'

$fullNrc = Convert::fullNrc('12/', 'YaKaNa', '(N)', 123456); 
// Or 
$fullNrc = Convert::fullNrc('12', 'YaKaNa', 'N', 123456);
// Example out  '12/YaKaNa(N)215556'

$mmFullNrc = Convert::mmFullNrc('၁၂/', 'ရကန', '(နိင်)', 123456); 
// Or
$mmFullNrc = Convert::mmFullNrc('၁၂', 'ရကန', 'နိင်', 123456); 
// example output '၁၂/ရကန(နိုင်)၂၁၅၅၅၆'

bash
php artisan vendor:publish --tag=convert