Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan Land landjonathan

View GitHub Profile
View render_form.php
<?php
function renderForm ($endpoint) {
// get the data from the API and convert it to a PHP object
$formResult = file_get_contents($endpoint);
$formContent = json_decode($formResult);
$formFields = $formContent->fields;
// start building the DOM
$dom = new DOMDocument();
$form = $dom->createElement('form');