I have a string like 09-10 which is representative of mm-dd. I need it in a format something like Monday 10th September? The problem is that I do not have a year and I can’t have an array containing months and days because I would like to know the day of the week (Mon, Tue, Wed etc.)
Any idea how to do this in PHP, preferably using date() to format the date?
Note: this is not in MySQL…
You can’t get the day (Monday, Tuesday etc) without knowing the year.
You can use
date('jS F', strtotime('2012-09-10'));to get the day of the month and month, just shove any old year in there. I’d make sure to use a leap year year though to make sure you catch those pesky feb dates properly.Example: http://codepad.org/JfUeTQlH
So, like this: