how to save checkboxes values in node programmatically i want to save checkboxes values in entity reference checkboxes field with node_save
:

   $form['wrapperrr']['id_offre'] = array(
        '#title' =&gt; t('Liste des Offres'),
        '#type' =&gt; 'checkboxes',
        '#options' =&gt; $optionsoffres,

    );


and into the submit button : 

$node-&gt;field_entity_reference['und'][]['value'] =$form_state['values']['wrapperrr']['id_offre'];
i found the solution
:

  $aaz= array_filter($form_state['values']['wrapperrr']['id_offre']);
 foreach($aaz as $of)
   {       

  //  $node-&gt;title = $form_state['values']['wrapperrr']['id_offre'][0]['value'];     
   $node-&gt;field_offre[LANGUAGE_NONE][]['target_id'] = $of;



   }