title: Need to perform an if statement inside a php foreach loop
body: <p>I'm working with the Filemaker API - which is similar to sql - basically its pulling data from a fields and from a list.</p>
  
  <p>I'm trying to set up an if statement inside my foreach loop so that it adds a the tag selected="selected" to my select option in my html</p>
  
  <p>Here's the code</p>
  
  <pre><code>&lt;?php
  
  $layout =&amp; $fm-&gt;getLayout('Leads');
  
  $values = $layout-&gt;getValueList('LeadStatus');
  
  $list_menu = '&lt;select name="LeadDocStatusSelect"&gt;';
  
  
  
  foreach ($values as $value) 
      {
      $list_menu .='&lt;option value="' . $value . '"&gt;' . $value . '&lt;/option&gt;' ;
      }
  
  
  $list_menu .= '&lt;/select&gt;';
  echo $list_menu;
  ?&gt;
  </code></pre>
  
  <p>How can I add an if statement like this to the foreach loop?</p>
  
  <pre><code>if ($businessJudgements == 'No') {
      echo 'checked="checked"';
  } else {
      echo '';
  }
  </code></pre>