You are here

function date_calc_get_month_from_fullname in Date 6.2

Same name and namespace in other branches
  1. 5.2 date_php4/date_php4_calc.inc \date_calc_get_month_from_fullname()
  2. 6 date_php4/date_php4_calc.inc \date_calc_get_month_from_fullname()

Returns the numeric month from the month name or an abreviation Both August and Aug would return 8.

Parameters

string $month: The name of the month to examine. Case insensitive.

Return value

integer The month's number.

File

date_php4/date_php4_calc.inc, line 585

Code

function date_calc_get_month_from_fullname($month) {
  $month = strtolower($month);
  $months = date_month_names();
  while (list($id, $name) = each($months)) {
    if (ereg($month, strtolower($name))) {
      return $id;
    }
  }
  return 0;
}