As strtotime () handles only date formats in English, you can try using this function, which I just made for you. With this, you can also process month names in other languages.
I donβt know if this is important for your application, but now you have it.
function getMonth($month, $leadingZero = true) { $month = strtolower(trim($month)); // Normalize $months = array('january' => '1', 'february' => '2', 'march' => '3', 'april' => '4', 'may' => '5', 'june' => '6', 'july' => '7', 'august' => '8', 'september' => '9', 'october' => '10', 'november' => '11', 'december' => '12', 'dezember' => '12', // German abrevation 'marts' => '3', // Danish abrevation for March ); if(isset($months[$month])) { return $leadingZero ? substr('0' . $months[$month], -2) : $months[$month]; } else { return false; } }
source share