Jump to content

listing days under months


Canman2005

Recommended Posts

Hi all

 

I have a simple script to print all months since a defined date, the code is

 

$startdate = "1 december 2007";

function printMonths($var)
{
$start = strtotime($var);
$now = strtotime("Now");
while ($start < $now)
{
echo date("F Y", $start);
echo "<BR>";
$start = strtotime("+1 month", $start);
}
}
printMonths($startdate);

 

Which prints something like

 

December 2007

January 2008

February 2008

March 2008

 

Is it possible to list all the days in each month under the month, so for example

 

December 2007

1

2

3

4

5

6

7

.etc.

January 2008

1

2

3

4

5

6

7

.etc.

 

is this possible?

 

cheers

 

ed

Link to comment
https://forums.phpfreaks.com/topic/96073-listing-days-under-months/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.