Advertisement
killerbng

Chinese Zodiac

Oct 7th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. function getChineseZodiac($year){
  2.     switch ($year % 12) :
  3.         case  0: return 'Monkey';  // Years 0, 12, 1200, 2004...
  4.         case  1: return 'Rooster';
  5.         case  2: return 'Dog';
  6.         case  3: return 'Boar';
  7.         case  4: return 'Rat';
  8.         case  5: return 'Ox';
  9.         case  6: return 'Tiger';
  10.         case  7: return 'Rabit';
  11.         case  8: return 'Dragon';
  12.         case  9: return 'Snake';
  13.         case 10: return 'Horse';
  14.         case 11: return 'Lamb';
  15.     endswitch;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement