Skip to content

Instantly share code, notes, and snippets.

@steffengrahl
Created September 7, 2016 07:21
Show Gist options
  • Save steffengrahl/4505fd149e429fe76c01834e24770db1 to your computer and use it in GitHub Desktop.
Save steffengrahl/4505fd149e429fe76c01834e24770db1 to your computer and use it in GitHub Desktop.
<form action="{{form_uri}}" method="post">
<label for="ort">Ort</label>
<input type="text" name="ort" id="ort" value="{{ort}}">
<input type="submit">
</form>
<?php
$formular = file_get_contents('form.html');
$array = array('form_uri' => 'do_something.php', 'ort' => 'automatisch eingesetzter Ort');
foreach ($array as $key => $value) {
$formular = str_replace('{{'.$key.'}}', $value, $formular);
}
echo $formular;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment