php - While statement infinite looping -


i can't life of me figure out why function in infinite loop. it's simple i'm not seeing. given year, prints out every month 7/[start-year] until month.

function showmonths($year) {      $start = strtotime($year.'-07-01');     $end = strtotime("now");  while($end >= $start) {    $months[] = strtotime("-1 month", $end);    $end = strtotime("-1 month", $end); } return $months;  } 


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -