If you want to specify only the month as input, repeat it with the total number of days in the month
Here is eval
<?php
$Days=array();
$Month = 8;
for($d=1; $d<=31; $d++)
{
$Time=mktime(12, 0, 0, $Month, $d, '2015');
if (date('m', $Time)==$Month)
$Days[]=date('Y-m-d-D', $Time);
}
echo '<pre>';
print_r($Days);
echo '</pre>';
?>
Note:
I gave the year directly, where you can give it a dynamic (user choice).
The days of the month are indicated directly as 31, you will find the number of days and give it too.
Update:
Because the OP wants to get only dates Monday.
<?php
$Days=array();
$Month = 12;
for($d=1; $d<=31; $d++)
{
$Time=mktime(12, 0, 0, $Month, $d, '2014');
if (date('m', $Time)==$Month)
$Day=date('D', $Time);
if($Day=='Mon')
{
$Days[]=date('Y-m-d-D', $Time);
}
}
echo '<pre>';
print_r($Days);
echo '</pre>';
?>
Here's an updated score
source
share