Skip to content

Instantly share code, notes, and snippets.

@phpfour
Created April 23, 2013 06:13
Show Gist options
  • Save phpfour/5441195 to your computer and use it in GitHub Desktop.
Save phpfour/5441195 to your computer and use it in GitHub Desktop.
Convert english date to bangla
<?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