diff options
Diffstat (limited to 'php/replace.php')
| -rw-r--r-- | php/replace.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/php/replace.php b/php/replace.php new file mode 100644 index 0000000..70fdd25 --- /dev/null +++ b/php/replace.php @@ -0,0 +1,13 @@ +<?php + +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; +} + +?> |
