title: PHP HTML output
body: <p>What is the correct way to output html inside a switch structure?</p>
  <p>I've tried both below, none work:</p>
  <pre><code>&lt;?php
  switch($x){
  
  case &quot;a&quot;:
  $var = &lt;&lt;&lt; EOM;
  ...the html...
  EOM;
  break;
  
  case &quot;b&quot;:
  ...some code...
  break;
  
  }
  ?&gt;
  </code></pre>
  <p>OR
  &lt;?php
  switch($x){</p>
  <pre><code>case &quot;a&quot;:
  ?&gt;
  ...the html...
  &lt;?php
  break;
  
  case &quot;b&quot;:
  ...some code...
  break;
  
  }
  ?&gt;
  </code></pre>
  <p>More info:</p>
  <pre><code>switch ($_REQUEST['act']){
  
      case 'editdiretorio':
      
      $sql=&quot;select * from diretorio where did=$_GET[edit]&quot;;
      $row=mysql_fetch_assoc(mysql_query($sql));
      
      ?&gt;
      &lt;h1&gt;Cadastro de Serviço&lt;/h1&gt;
      &lt;form id=&quot;fdiretorio&quot; method=&quot;post&quot; action=&quot;diretorioconfirm.php&quot;&gt;
      &lt;?php if($edit){echo &quot;&lt;input name='act' type='hidden' value='update'&gt;&quot;;?&gt;
             Nome completo de quem preenche o questionário:&lt;br /&gt;
        &lt;input type=&quot;text&quot; name=&quot;dnome&quot; class=&quot;form-default&quot; style=&quot;width:200px;&quot; value=&quot;&lt;?php echo &quot;$row[dnome]&quot;;?&gt;&quot;/&gt;
        &lt;br /&gt;
  </code></pre>
  <p>... more 400 lines of code ...</p>
  <pre><code>&lt;?php
  break;
  
  case &quot;b&quot;:
  ... other code ...
  </code></pre>