I am trying to convert a string to date. The strings i have look like these:
$string_jan = '01'; // 01 represents january
$string_feb = '02'; // 02 represents february
...
$string_dec = '12'; // 12 represents december
This works fine:
$string = '24-09-2020';
$date = strtotime($string);
echo date('M', $date); // output Sep
But this does not work:
$string = '09'; // month september
$date = strtotime($string);
echo date('M', $date); // output Jan ??
How can i convert this into the first 3 letters of a month using date
?