Thursday, July 16, 2015

PHP: function: monthENtoJP

// 月を英語から数値へ
function monthENtoJP($en)
{
   $monthENtoNum = array(
      "Jan" => 1 , 
      "Feb" => 2 , 
      "Mar" => 3, 
      "Apr" => 4, 
      "May" => 5, 
      "Jun" => 6, 
      "Jul" => 7, 
      "Aug" => 8, 
      "Sep" => 9, 
      "Oct"=> 10, 
      "Nov" => 11, 
      "Dec" => 12);

   return $monthENtoNum[$en];
}

No comments: