Zitat Zitat von drunken monkey Beitrag anzeigen
Du änderst einfach die "3" in der dritten Zeile in was anderes ab, solange du nicht mehr als 12 Monate in die Zukunft springst, bleibt's gültig. Ansonsten statt dem hier:
PHP-Code:
if($month 12) {
  
$year   date('Y'$timestamp) + 1;
  
$month %= 12;
} else {
  
$year   date('Y'$timestamp);

Das hier:
PHP-Code:
$year date('Y'$timestamp);
while (
$month 12) {
    
$month -= 12;
    ++
$year;

Oder aber:
PHP-Code:
$year date('Y'$timestamp) + floor($month 12);
$month %= 12;
if(
$month 0) {
  
$month += 12;

Wieder mal ungetestet. Hat allerdings den Vorteil, dass auch "negative" Monatssprünge möglich sind.