Boolean checkbox in sytems_settings_form I have written the following code

$form['checking'] = array(
    '#type' =&gt; 'checkbox',
    '#default_value' =&gt; variable_get('checking',0),
    '#title' =&gt; t('title'),
    '#required' =&gt; TRUE
  );

  return system_settings_form($form);


the checkbox preserve its checked and unchecked state in the form but I can't get value of the checkbox.

I'm printing its value 

dsm(variable_get('checking);
print_r(variable_get('checking',0));


Whether a checkbox is checked or unchecked, in both cases it returns me 1

How can I know whether the checkbox is checked or not?
Have you tried removing the "#required" => TRUE line? If you uncheck the checkbox and the form item is required the form won't validate and your submit callback will not be called.

Also, you should check that your variable isn't overridden in settings.php https://www.drupal.org/node/1525472