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 Link to comment https://forums.phpfreaks.com/topic/103177-outting-days-in-month/ 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 />'); ?> Link to comment https://forums.phpfreaks.com/topic/103177-outting-days-in-month/#findComment-528504 Share on other sites More sharing options...
Canman2005 Posted April 27, 2008 Author Share Posted April 27, 2008 legend, thank you Link to comment https://forums.phpfreaks.com/topic/103177-outting-days-in-month/#findComment-528522 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.