Wednesday, January 2, 2013

Weeks Inside a Quarter


/*
 * Weeks in Current Quarter
 */
We can get the Current Quarter starting date and ending date through this below link,
http://phpndrupal.blogspot.in/2013/01/current-quarter-of-year.html


$quarter_start_date = $quarter_date[0];
$quarter_end_date = $quarter_date[1];

function WeeksInsideQuarter($quarter_start_date, $quarter_end_date){
    $start_date = strtotime($quarter_start_date);
    $end_date = strtotime($quarter_end_date);
    for($i=1; $i<15; $i++, $start_date+=604800){
        $week_dates[$i] = $start_date;
    }
    return $week_dates;

No comments:

Post a Comment