Loop through multiple values from an array to create multiple arrays I have $host_entity which contains:
field_eventorganizer (Array, 1 element)
und (Array, 3 elements)
0 (Array, 1 element)
target_id (String, 2 characters ) 20
1 (Array, 1 element)
target_id (String, 4 characters ) 345
2 (Array, 1 element)
target_id (String, 2 characters ) 678

and the below code in which I need to create multiple arrays inside the array('#markup'.
$organisers=user_load($host_entity-&gt;field_eventorganizer['und'][0]['target_id']);
$organiser_email=$organisers-&gt;mail;
    $build['field_eventorganizer'] = array(
    '#theme' =&gt; 'registration_property_field',
    '#label' =&gt; 'Event Organiser(s)',
    '#items' =&gt; array(
        array('#markup' =&gt; l($username, 'mailto:' . $organiser_email, array('absolute' =&gt; TRUE)),),
        ),
        '#classes' =&gt; 'field field-label-inline clearfix',
    );

Do I need to create a foreach loop after array('#markup' =&gt; ?
Try this to loop the $build variable :)
// define variables
$organisers[] = &quot;&quot;;
$organiser_email = &quot;&quot;;
$organiser_name = &quot;&quot;;
$email_delimiter = &quot;; &quot;;

// recreate the array from your example
$organisers['und'][0]['target_id'] = 20;
$organisers['und'][1]['target_id'] = 345;
$organisers['und'][2]['target_id'] = 678;

// populate $build variable
$build['field_eventorganizer'] = array(
      '#theme' =&gt; 'registration_property_field',
      '#label' =&gt; 'Event Organiser(s)2',
      '#classes' =&gt; 'field field-label-inline clearfix',
    );

// because the numbers are nested in the array, I've chosen to use `for` instead of 
// `foreach` to use $i as the iterator then rebuild what I'm looking for in the loop. I've 
// used count($organisers['und']) because the next piece of the array is the number we are
// using to load user data.

for ($i = 0; $i &lt; count($organisers['und']); $i++) {
    // load the user object based on $i
    $organisers = user_load($host_entity-&gt;field_eventorganizer['und'][$i]['target_id']);
    // fetch loaded users email
    $organiser_email = $organisers-&gt;mail;
    // fetch loaded users name
    $organiser_name = $organisers-&gt;name;
    // populate $build variable
    $build['field_eventorganizer'][] = array(
      '#items' =&gt; array(
        array('#markup' =&gt; l($organiser_name, 'mailto:' . $organiser_email, array('absolute' =&gt; TRUE)),),
      ),
    );
}

Side note: Not sure if it was intentional or not, but be careful of your plurals. You are using $organisers and $organiser_email which can sometimes be missed and cause a headache.