Created
October 9, 2019 08:15
-
-
Save hmbashar/4722e62c5ac71c222f77205af3c4e823 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| class BanglaConverter { | |
| public static $bn = array("১", "২", "৩", "৪", "৫", "৬", "৭", "৮", "৯", "০"); | |
| public static $en = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); | |
| public static function bn2en($number) { | |
| return str_replace(self::$bn, self::$en, $number); | |
| } | |
| public static function en2bn($number) { | |
| return str_replace(self::$en, self::$bn, $number); | |
| } | |
| } | |
| echo BanglaConverter::bn2en("This is ২০১৬\n"); | |
| echo BanglaConverter::en2bn("42 আমার প্রিয় সংখ্যা\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using this code on my site Converter Web Tools (bangla converter)