asked on
ASKER
if ($period == "Monthly") {
$interval = '1';
}
elseif ($period == "Quarterly") {
$interval = '3';
}
elseif ($period == "Semi-Annual") {
$interval = '6';
}
elseif ($period == "Annual") {
$interval = '12';
}
//$start_datea is set in the form. So it might be 2007-07-31 and end_date is the same and could be for example 2008-07-31
$reportdate = $start_datea;
while ($reportdate <= $end_date) {
$arrgc = explode("-", $reportdate);
$reportdate = date("Y-m-d", mktime(0,0,0, $arrgc[1]+$interval, $arrgc[2], $arrgc[0]));
}
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY