. */ function replace(string $templatePath, array $replacements = []): string { $html = file_get_contents($templatePath); foreach ($replacements as $placeholder => $replacementValue) { $html = str_replace($placeholder, $replacementValue, $html); } return $html; } ?>