Skip to content

Instantly share code, notes, and snippets.

@joffilyfe
Created July 17, 2016 13:43
Show Gist options
  • Save joffilyfe/54fbbbc5c2614d26be660e9e48b48676 to your computer and use it in GitHub Desktop.
Save joffilyfe/54fbbbc5c2614d26be660e9e48b48676 to your computer and use it in GitHub Desktop.
Exemplo para criação de um formulário dinâmico
<?php
$inputs = array(
"nome" => "Joffily",
"idade" => "18",
"musica" => "Gibe my monei"
);
?>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form action="/" method="GET">
<?php
foreach ($inputs as $chave => $valor) {
echo "<label>$chave</label>";
echo "<input type='text' name='$chave' value='$valor' /></br>";
}
?>
<button>Enviar</button>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment