title: Problems with layout in switch
body: <p>Seems like i haven't really figured out how the switch works, cause it is impossible (for me) to get it right.</p>
  
  <p>I have this code:</p>
  
  <pre><code>foreach ($this-&gt;timeofday as $key =&gt; $node) {
      if (get_class($node) === 'DOMElement') {
          if ($node-&gt;hasAttribute('class')) {
              switch ($node-&gt;getAttribute('class')) {
                  case "cmil_salong":
                      echo '&lt;h3&gt;'.$node-&gt;nodeValue. '&lt;/h3&gt;';
                      break;
                  case "cmil_time":
                      echo $node-&gt;nodeValue .' ';
                      break;
                  case "mv_3d":
                      echo '&lt;span class="label label-info"&gt;3D&lt;/span&gt; ';
                      break;
                  case "cmil_rs":
                      echo '&lt;span class="label label-info"&gt;Platser ' . $node-&gt;nodeValue . '&lt;/span&gt; ';
                      break;
                  case "mv_txt":
                      echo '&lt;span class="label label-info"&gt;Textad&lt;/span&gt;&lt;br&gt;';
                      break;
              }
          }
      }
      if (get_class($node) === 'DOMAttr') {
          if ($node-&gt;nodeName === 'href') { ?&gt;
                  &lt;a href="&lt;?php echo  $node-&gt;nodeValue ?&gt;"&gt;&lt;button type="button" class="btn btn-success btn-xs"&gt;book! &lt;span class="glyphicon glyphicon-new-window"&gt;&lt;/span&gt;&lt;/button&gt;&lt;/a&gt;&lt;br&gt;
              &lt;?php
          }
      }
  }
  </code></pre>
  
  <p>That produces this:</p>
  
  <pre><code>&lt;h3&gt;FS 4&lt;/h3&gt;10:50 
  &lt;span class="label label-info"&gt;Platser 74&lt;/span&gt; 
  &lt;span class="label label-info"&gt;3D&lt;/span&gt; 
  &lt;span class="label label-info"&gt;Textad&lt;/span&gt;&lt;br&gt;
  &lt;button type="button" class="btn btn-success btn-xs"&gt;book! &lt;span class="glyphicon glyphicon-new-window"&gt;&lt;/span&gt;&lt;/button&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/wGdSW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wGdSW.png" alt="How it looks"></a></p>
  
  <p>But this is the expected result:</p>
  
  <p><a href="https://i.stack.imgur.com/QyTTO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QyTTO.png" alt="How i want it to look"></a> </p>
  
  <p>Preferably</p>
  
  <pre><code>&lt;div&gt;
      11:30 &lt;span class="label label-info"&gt;3D&lt;/span&gt; &lt;span class="label label-info"&gt;textad&lt;/span&gt; &lt;span class="label label-info"&gt;platser 379&lt;/span&gt;
        &lt;span class="label label-warning"&gt; Du kan inte l&amp;#228;ngre k&amp;#246;pa biljetter till den h&amp;#228;r f&amp;#246;rest&amp;#228s;llningen&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Or, depending on <code>if ($node-&gt;nodeName === 'href')</code> is true:</p>
  
  <pre><code>&lt;div&gt;
      11:30 &lt;span class="label label-info"&gt;3D&lt;/span&gt; &lt;span class="label label-info"&gt;textad&lt;/span&gt; &lt;span class="label label-info"&gt;platser 379&lt;/span&gt;
  &lt;button type="button" class="btn btn-success btn-xs"&gt;book! &lt;span class="glyphicon glyphicon-new-window"&gt;&lt;/span&gt;&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <h1><strong>My question:</strong></h1>
  
  <ol>
  <li>How do i make it look like: the second image: <a href="https://i.stack.imgur.com/QyTTO.png" rel="nofollow noreferrer">http://i.stack.imgur.com/QyTTO.png</a></li>
  </ol>