Hello. I want to generate the initial of the day of all the days of a chosen month. Meaning, if I choose this month it will give me:
TFSSMTWTFSSMTWTFSSMTWTFSSMTWTF
Is that clear? Can anybody help me? thanks!
Generate days of the month
Moderator: General Moderators
Re: Generate days of the month
sure... why not?.... her you go :Is that clear? Can anybody help me?
http://us.php.net/manual/en/ref.datetime.php
Re: Generate days of the month
Honestly, I tried. The only reason why I posted that here is because I havent found the way how to figure it out
Re: Generate days of the month
Generate a timestamp for the first day of the month. Then, using that timestamp, find the day of the week & get the first character. Increment your timestamp by 1 day using strtotime() & repeat. Continue until your timestamp is greater than the timestamp of the last day of the month.
There are probably more efficient ways of doing this with a for loop & arrays, but this'll at least get you started.
There are probably more efficient ways of doing this with a for loop & arrays, but this'll at least get you started.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.