Toggle navigation
Genres
Frontend (2)
JavaScript (6)
Database (2)
Linux Server (3)
Web Apps (4)
Misc (4)
Search
List
New Tutorials
Last Modified Tutorials
</>
Code examples
code
smiko
frontend
html
examples
forms
44passvars_php_select_multiple.php
44passvars_php_select_multiple.php
<!DOCTYPE HTML> <html lang="hr"> <head> <meta charset="UTF-8"> <title>Multiple select is array - PHP</title> </head> <body> Hold CTRL or SHIFT when selecting multiple items. <br> <form action="44passvars_php_select_multiple.php" method="POST" enctype="application/x-www-form-urlencoded"> <select name="naselje[]" size="6" multiple> <option value="NAŠICE">Našice</option> <option value="VALPOVO">Valpovo</option> <option value="OSIJEK">Osijek</option> <option value="ĐAKOVO">Đakovo</option> </select> <br> <br> <input type="submit" value="Send"> <input type="reset" value="Reset the form"> </form> <br> <hr> <?php foreach($_POST['naselje'] as $naselje): ?> <br><?= $naselje ?> <?php endforeach; ?> <br> <hr> <?php var_dump($_POST['naselje']); ?> </body> </html>
Reload page
Preview
W3C validation
Edit Code