What is the issue with sending a variable through a checkbox in PHP?

When sending a variable through a checkbox in PHP, the issue is that if the checkbox is not checked, the variable will not be sent in the form submission. To solve this issue, you can use a hidden input field in conjunction with the checkbox. This way, even if the checkbox is not checked, the hidden input field will still send the variable.

<input type="checkbox" name="my_checkbox" value="1">
<input type="hidden" name="my_checkbox" value="0">