1<!--
2 You can also group multiple checkboxes by giving them the same "name".
3 When posted to PHP, all the checked boxes' values will appear in the
4 $_POST array under an index with the same name as your checkboxes.
5
6 E.g. if we check "bananas" and "apples" below and post the form then
7 our $_POST array will look something like this:
8 ['fruit' => ['bananas', 'apples']]
9-->
10<form>
11 <label>
12 <span>Bananas</span>
13 <input type="checkbox" name="fruit[]" value="bananas">
14 </label>
15
16 <label>
17 <span>Apples</span>
18 <input type="checkbox" name="fruit[]" value="apples">
19 </label>
20
21 <label>
22 <span>Grapes</span>
23 <input type="checkbox" name="fruit[]" value="grapes">
24 </label>
25
26 <button type="submit">Submit</button>
27</form>
1<input type="checkbox" id="vehicle1" name="vehicle1" value="Bike">
2<label for="vehicle1"> I have a bike</label><br>