Created
January 13, 2021 06:02
-
-
Save cithukyaw/be9bca629e8472304ff48a452ca1f038 to your computer and use it in GitHub Desktop.
Convert English number to Myanmar number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert English number to Myanmar number | |
* @param string $num | |
* @return string | |
*/ | |
function en2myNum($num) | |
{ | |
$digits = array( | |
'/0/' => '၀', | |
'/1/' => '၁', | |
'/2/' => '၂', | |
'/3/' => '၃', | |
'/4/' => '၄', | |
'/5/' => '၅', | |
'/6/' => '၆', | |
'/7/' => '၇', | |
'/8/' => '၈', | |
'/9/' => '၉', | |
); | |
return preg_replace(array_keys($digits), array_values($digits), $num); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment