Skip to content

Instantly share code, notes, and snippets.

@saturngod
Last active December 12, 2015 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saturngod/4707094 to your computer and use it in GitHub Desktop.
Save saturngod/4707094 to your computer and use it in GitHub Desktop.
mahabote
<?php
$arr[0] ="အဓိပတိ";
$arr[1] = "ဘင်္ဂ";
$arr[2] = "မရဏ";
$arr[3] = "အထွန်း";
$arr[4] = "သိုက်";
$arr[5] = "ရာဇ";
$arr[6] = "ပုတိ";
$n = 5; // modulo
$k = 3; // day , 3 is Tue
//$res = ((2*$n)+((8-(2*$k)) % 7)) % 7;
$res= ( 2* $n + 1 - 2 * k ) % 7 //Simplifying
if($res < 0) {
// -1 mod 7 should be 6 but php return -1
$res = 7 + $res1;
}
echo $arr[$res];
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment