Canman2005 Posted April 27, 2008 Share Posted April 27, 2008 hi all i have a php code which prints a month, such as March 2008 or April 2009 Is it possible to give php a date, such as $date = "march 2008"; and get php to output everyday in that month, so with the above date it would output everyday in March in the format 1 2 3 4 5 6 7 8 9 10 ... is suggestions anyone? thanks in advance dave Quote Link to comment Share on other sites More sharing options...
thebadbad Posted April 27, 2008 Share Posted April 27, 2008 The simple way: <?php $date = 'march 2008'; $days = range(1, date('t', strtotime($date))); echo implode($days, '<br />'); ?> Quote Link to comment Share on other sites More sharing options...
Canman2005 Posted April 27, 2008 Author Share Posted April 27, 2008 legend, thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.