Advertisement
MizunoBrasil

Dropdown Option Value para formulário HTML/PHP via array 2

Jun 17th, 2024
684
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. <?php
  2.     $categoria = ["Aplicativos", "Cinema", "Comportamento", "Copa do Mundo", "Música", "Podcast", "Programação", "Streaming"];
  3. ?>
  4. <div class="form-group">
  5.     <label>Selecione a categoria</label>
  6.     <select class="form-control" name="categoria">
  7.         <?php foreach ($categoria as $c) { ?>
  8.             <option value="<?= $c; ?>"> <?= $c; ?> </option>
  9.         <?php } ?>
  10.     </select>
  11. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement