Checkbox returning value as array

0 votes
asked Sep 10, 2017 by user2912466

So I have four checkboxes:

<input type='checkbox' name='checkbox1' value=1>
<input type='checkbox' name='checkbox2' value=1>
<input type='checkbox' name='checkbox3' value=1>
<input type='checkbox' name='checkbox4' value=1>

I collect the values in a PHP key value array called varList. Three of these checkboxes return what I expect, but one looks like it is returning an array.

["checkbox1"]=> string(1) "1"
["checkbox2"]=> string(1) "1" 
["checkbox3"]=> string(1) "1"
["checkbox4"]=> array(1) { [0]=> string(9) "checkbox4"

All the checkboxes are identical, I don't understand why I would return a value that isn't represented in the checkbox element?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
Welcome to Q&A, where you can ask questions and receive answers from other members of the community.