Nov 28
icon1 admin | icon2 technical | icon4 11 28th, 2008| icon3 No Comments »
Tags: , ,

need a way to find all the dates in between? well this currently works with months. but can be adjusted to do days, years, etc. all you need to do is supply a begining date and an end date. it returns an array which can be used for anything,

function between_dates($begin_date, $end_date) {
    $t = date("Y-m",strtotime($begin_date));
       
    $i=0;
    do {
    $my[$i] = date("F Y", (strtotime("{$end_date} +$i months")));
    $mys = date("Y-m", (strtotime("{$end_date} +$i months")));
    $i++;
    }
    while($mys < $t);

    return $my;
}

Your Ad Here
Get Adobe Flash playerPlugin by wpburn.com wordpress themes