PHP

Checkbox

By December 20, 2018 January 14th, 2020 No Comments

If you have two checkboxes with same name (value should of course be different).

When user submits a form with one selected. In PHP you will get the value as a string for the checked checkbox. Interestingly if user checks both, PHP gives an array and this is without specifying name with an array.