how to add checkbox value as json data I have created a custom module for a form. And  I have json data which I want to add as checkbox values. 

$request = drupal_http_request($url);
$jsonarray =drupal_json_decode($request-&gt;data);
print_r($jsonarray);
 foreach($jsonarray as $info) {
$output1 =$info[0];
$output2 =$info[1];
$output3 =$info[2];
}

 echo $output1;
Set

'#checked' =&gt; !empty($default_value)?1:0, 

in your form checkbox field.