Advertisement
MizunoBrasil

Dropdown Option Value para formulário HTML via array

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