How to read if a checkbox is checked in PHP?
You can do it with the short if:
$check_value = isset($_POST['my_checkbox_name']) ? 1 : 0;
or with the new PHP7 Null coalescing operator
Null coalescing operator
$check_value = $_POST['my_checkbox_name'] ?? 0;