PHP mini-password-box: Too many loops &lt;div class="minipassbox" style="margin-top: 5px;"&gt;
               &lt;?php
                   for($i = 1; $i &lt;= 3; $i++) {
                      $marginRight = ($i &lt; 3 ? "margin-right:4px" : "");
                      echo "&lt;div style='width:56px;float:left;{$marginRight}'&gt;";
                      echo "&lt;label for='param_kind{$i}' style='padding-left:4px;'&gt;{$i}. Kind&lt;/label&gt;";
                      echo "&lt;select id='param_kind{$i}' class='selFields' name='param_kind{$i}' style='margin-top:3px'&gt;";
                      echo  "&lt;option selected='' value='-1'&gt;--- &lt;/option&gt;";
                      for($j = 1; $j &lt;= 16; $j++) {
                         $selected = ($oRecherche-&gt;getParamValue("param_kind{$i}") == $j ? "selected='selected'" : "");
                         $option_text = ($j == 1 ? "&amp;lt; 2 Jah." : $j + "Jahre");
                         echo "&lt;option value='{$j}' {$selected}&gt;{$option_text}&lt;/option&gt;";
                      }
                      echo "&lt;/select&gt;";
                      echo "&lt;/div&gt;";
                   }   
               ?&gt;
               &lt;div style="clear:left"&gt;&lt;/div&gt;
            &lt;/div&gt;
Two advices:


Use PHP alternative syntax

When mixing HTML and PHP, it is a good practice to use  PHP alternative syntax:

&lt;?php for ($i = 1; $i &lt;= 3; $i++): ?&gt;
..
&lt;?php endfor ?&gt;

Improve the HTML code


Use double quotes in tag attributes (HTML standard)
Try to respect indentation
Move style to css declarations



Final code proposition:

&lt;style type="text/css"&gt;
  .minipassbox {
    margin-top: 5px;
  }
  .minipassbox &gt; div {
    width: 56px;
    float: left;
  }
  .minipassbox &gt; div.lt3 {
    margin-right: 4px;
  }
  .minipassbox label {
    padding-left: 4px;
  }
  .selFields {
    margin-top: 3px;
  }
  .boxclear {
    clear: left;
  }
&lt;/style&gt;
&lt;div class="minipassbox"&gt;
&lt;?php for ($i = 1; $i &lt;= 3; $i++): ?&gt;
  &lt;div &lt;?php echo $i &lt; 3 ? ' class="lt3"' : '' ?&gt;
    &lt;label for="param_kind&lt;?php echo $i ?&gt;"&gt;&lt;?php echo $i ?&gt;. Kind&lt;/label&gt;
    &lt;select id="param_kind&lt;?php echo $i ?&gt;" class="selFields" name="param_kind&lt;?php echo $i ?&gt;"&gt;
      &lt;option value="-1"&gt;--- &lt;/option&gt;
      &lt;?php for ($j = 1; $j &lt;= 16; $j++): ?&gt;
      &lt;option value=""&lt;?php echo $j ?&gt;"&lt;?php echo $oRecherche-&gt;getParamValue("param_kind$i") == $j ? ' selected="selected"' : '' ?&gt;&gt;&lt;?php echo $j == 1 ? "&amp;lt; 2 Jah." : $j + "Jahre" ?&gt;&lt;/option&gt;
      &lt;?php endfor ?&gt;
    &lt;/select&gt;
  &lt;/div&gt;
&lt;?php endfor ?&gt;
  &lt;div class="boxclear"&gt;&lt;/div&gt;
&lt;/div&gt;