PHP Date Output Months

Here is a fun way to output the months of the year by generating an arbitrary date then using the date() function to get the textual month name. This si a clean way to populate a month list menu or any other calendar functionality:

PHP:
  1. for($i=1; $i<=12; $i++){
  2.      $month = date('F',mktime(0, 0, 0, $i, 11, 1978));
  3. }

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • Reddit
  • Furl
  • NewsVine
  • Simpy
  • Slashdot
  • Spurl
  • StumbleUpon
  • YahooMyWeb
  • TailRank

Home | PHP | PHP Date Output Months