How do I add field collection unlimited items from hook_form_alter()?
here in my below example i want to attach 5 images which will save in admin field collection , so here is code for it . here 109is node id in which i want to save field collection value. field_manager_update is my field collection name.

&lt;?php $images = array(//images to attach to node
    '0' =&gt; 'http://cf.juggle-images.com/matte/white/280x280/drupal-logo-primary.jpg',
    '1' =&gt; 'http://cdn.flaticon.com/png/256/37187.png',
    '2' =&gt; 'https://www.drupal.org/files/project-images/logo-128x128.jpg',
    '3' =&gt; 'http://guillermocerezo.com/sites/default/files/field/image/drupal-logo_0.jpg',
    '4' =&gt; 'http://drupalcrafters.org/sites/default/files/DrupalCraft-logo_0.png'
  );

$node = node_load(109);

$field_collection_value = entity_create('field_collection_item', array('field_name' =&gt; 'field_manager_update'));

// Attach to the node
$field_collection_value-&gt;setHostEntity('node', $node);

for ($i = 0; $i &lt; sizeof($images); $i++) {        
    $file_info = system_retrieve_file($images[$i], 'public://pictures/', TRUE, FILE_EXISTS_RENAME); //storing image inside picture folder
    if ($file_info-&gt;fid) {//if fid exist then image is saved from URL.
      //$node-&gt;field_prop_land_image[LANGUAGE_NONE][$i]['fid'] = $file_info-&gt;fid; //assign
      $field_collection_value-&gt;field_prop_update_image[LANGUAGE_NONE][$i]['fid'] = $file_info-&gt;fid;
    }        
}    
// Save field-collection item.
$field_collection_value-&gt;save();  ?&gt;


Hope it helps :)