Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
1.2 kB
2
Indexable
Never
<?php

$month = "05";
$year = "2014";

$start_date = "01-".$month."-".$year;
$start_time = strtotime($start_date);

$end_time = strtotime("+1 month", $start_time);

for($i=$start_time; $i<$end_time; $i+=86400)
{
   $list[] = date('Y-m-d-D', $i);
}

print_r($list);



//output

Array
(
    [0] => 2014-05-01-Thu
    [1] => 2014-05-02-Fri
    [2] => 2014-05-03-Sat
    [3] => 2014-05-04-Sun
    [4] => 2014-05-05-Mon
    [5] => 2014-05-06-Tue
    [6] => 2014-05-07-Wed
    [7] => 2014-05-08-Thu
    [8] => 2014-05-09-Fri
    [9] => 2014-05-10-Sat
    [10] => 2014-05-11-Sun
    [11] => 2014-05-12-Mon
    [12] => 2014-05-13-Tue
    [13] => 2014-05-14-Wed
    [14] => 2014-05-15-Thu
    [15] => 2014-05-16-Fri
    [16] => 2014-05-17-Sat
    [17] => 2014-05-18-Sun
    [18] => 2014-05-19-Mon
    [19] => 2014-05-20-Tue
    [20] => 2014-05-21-Wed
    [21] => 2014-05-22-Thu
    [22] => 2014-05-23-Fri
    [23] => 2014-05-24-Sat
    [24] => 2014-05-25-Sun
    [25] => 2014-05-26-Mon
    [26] => 2014-05-27-Tue
    [27] => 2014-05-28-Wed
    [28] => 2014-05-29-Thu
    [29] => 2014-05-30-Fri
    [30] => 2014-05-31-Sat
)