title: PHP: Concat a string in a foreach loop
body: <p>How can I concat a string inside a for each loop? What I'm doing below works ok without the loop, but is there a way I can put the loop in there without ending the <code>$body[{{body}}]</code> and starting it again?</p>
  
  <pre><code>$carrier = array (
      'SAS' =&gt; array('alias' =&gt; 'sas', 'name' =&gt; 'SAS'),
      'British Airways' =&gt; array('alias' =&gt; 'british_airways', 'name' =&gt; 'British Airways')
  );
  
  $body['{{body}}'] = '';
  
  $body['{{body}}'] .= 'Line one'.
  
      foreach ($carrier as $key=&gt;$value) {
          '&lt;option value='.$value['alias'].'&gt;'.$value['name'].'&lt;/option&gt;'.;
      }
  
  'Line two'.
  'Line three'.
  'Line four';
  
  print_r($body);
  </code></pre>