format('l d.m.Y'); // z.B. Monday 08.04.2025
$dateShort = $dateObj->format('d.m.'); // z.B. 08.04.
// Deutsch Wochentag optional
setlocale(LC_TIME, 'de_DE.UTF-8');
$weekday = strftime('%A', $dateObj->getTimestamp());
$html = <<
{$weekday} {$dateObj->format('d.m.Y')}, {$time}, Canyoning Tour, {$price} [/vc_column_text]Plätze frei: 16 — Auslastung: normale Auslastung erwartet
Hinweis: Video & Impressionen → YouTube-Link in der Tourbeschreibung
[/vc_column]
[/vc_row] EOT;
return $html;
} // Generieren
$out = "";
$cur = clone $start;
while ($cur <= $end) {
$out .= make_vc_block($cur, $time, $price, $tourLink, $contactUrl);
$cur->modify('+1 day');
} // Ausgabe (in Datei oder direkt drucken)
$file = __DIR__ . '/vc_tour_blocks_until_2026-05-15.html';
file_put_contents($file, $out);
echo "VC-Code erzeugt und gespeichert in: {$file}\n";
echo "Länge: " . strlen($out) . " Zeichen\n";
// optional: echo $out;