diff options
| author | Connor Thomson <blumatrikz@gmail.com> | 2026-09-18 17:23:39 -0700 |
|---|---|---|
| committer | Connor Thomson <blumatrikz@gmail.com> | 2026-09-18 17:23:39 -0700 |
| commit | 94a6551bafd51deb2bfae144336689eb0472abf6 (patch) | |
| tree | 103db6511e06a43dbc90fc26b89ded9ca519a3d3 /php/replace.php | |
Upload files from test.gnufault.org
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; +} + +?> |
