Created
April 23, 2013 06:13
-
-
Save phpfour/5441195 to your computer and use it in GitHub Desktop.
Convert english date to bangla
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
<?php | |
function getBanglaDate($date) | |
{ | |
$engArray = array( | |
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, | |
'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', | |
'am', 'pm' | |
); | |
$bangArray = array( | |
'১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯', '০', | |
'জানুয়ারি', 'ফেব্রুয়ারি', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর', | |
'সকাল', 'দুপুর' | |
); | |
$converted = str_replace($engArray, $bangArray, $date); | |
return $converted; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment