I am a bit new to PHP is there a way to display a month in succession?
the sample is my first date is July 01, 2018
the output should be
July 01, 2018
Aug 01, 2018
Sept 01, 2018 ..
and so on until to the date I declare
Update: here is my code
$propd = "SELECT * FROM tbl_sample WHERE Person_ID = ".$Person_ID;
$prop_counter = $conn->query($propd);
while($pcount_Row = $prop_counter->fetch_assoc()) {
$Acceptance_Date = $pcount_Row["Accpt_Date"];
}
/////////////////////////////
$NAcceptance_Date = strtotime($Acceptance_Date);
$nMonth = strtotime($Acceptance_Date);
$Start_Date = date('M d,Y', $NAcceptance_Date);
$x=1;
$Month_Counter=1;
$Monthly[$x] = $Start_Date;
//echo $Monthly[$x];
$x++;
$JDate=strtotime("June 01, 2018");
$JuneDate = date("M d,Y", $JDate);
while ($Start_Date != $JuneDate)
{
$Start_Date = date("M d, Y", strtotime("+1 month", $nMonth));
$nMonth= strtotime($Start_Date);
echo $Start_Date . "-" . $JuneDate . "<br>";
}
where
$Acceptance_Date = July 01, 2009
$JuneDate = June 01, 2018
but my won't stop at June 01, 2018