Tous les collages #14976 Brut Modifier

Someone

public php v1 · immuable
#14976 ·publié 2005-06-18 20:31 UTC
corps du collage affiché
<?$pkg['cp_billing_cycle'] = 3;$pkg['cp_last_renew_year'] = '2005';$pkg['cp_last_renew_month'] = '7';$renewals = ceil(12 / $pkg['cp_billing_cycle']);$last_renewal_year = $pkg['cp_last_renew_year'];$next_renewal = $pkg['cp_last_renew_month'];for($i = $renewals; $i >= 0; $i--){  $next_renewal += $pkg['cp_billing_cycle'];  if ($next_renewal > 12)  {    $next_renewal -= 12;    $last_renewal_year += 1;  }   echo 'Month: '.$next_renewal.' Year: '. $last_renewal_year."\n";} // This outputs:/*Month: 10 Year: 2005Month: 1 Year: 2006Month: 4 Year: 2006Month: 7 Year: 2006Month: 10 Year: 2006*/?>