Returns
checked="checked" string if the parameter value is TRUE.
Use this function to program form checkboxes.
The following code example creates a checkbox with name "extra_option". The checkbox is automatically checked if the POST array
contains 'extra_option' element and its value is TRUE.
<input name="extra_option" <?= checkbox_state(post('extra_option')) ?> value="1" type="checkbox"/>