forumnz Posted June 7, 2008 Share Posted June 7, 2008 How can this be done? Like for example if I wanted to display from Jan to Jun. Thanks, Sam. Link to comment https://forums.phpfreaks.com/topic/109175-display-the-past-6-months/ Share on other sites More sharing options...
Lefteris Posted June 7, 2008 Share Posted June 7, 2008 I guess you can play with the time and date functions to get any result you want any way you want it. For more information go here : Date and Time functions Link to comment https://forums.phpfreaks.com/topic/109175-display-the-past-6-months/#findComment-560017 Share on other sites More sharing options...
GingerRobot Posted June 7, 2008 Share Posted June 7, 2008 strototime() is your friend: <?php for($x=0;$x<6;$x++){ echo date('F',strtotime('-'.$x.' months')).'<br />'; } ?> Link to comment https://forums.phpfreaks.com/topic/109175-display-the-past-6-months/#findComment-560033 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.