HTML5 Beginner Forms · 1 min read

Checkboxes as PHP arrays

Start the HTML5 learning path »

❮ HTML5 Home All Tutorials ❯

How do I submit multiple checkboxes to PHP?

name[] pattern.

Example

Interactive preview available
HTML5 Example
<label><input type="checkbox" name="skills[]" value="html"> HTML</label>
<label><input type="checkbox" name="skills[]" value="css"> CSS</label>
<label><input type="checkbox" name="skills[]" value="js"> JS</label>

Line-by-Line Walkthrough

PHP receives $_POST['skills'] as an array.

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share

Reactions

Loading reactions…