title: Escape PHP Switch Variable String
body: <p>In PHP, we can escape to HTML in a switch statement like this:</p>
  
  <pre><code>&lt;?php
      switch($example) {
          case 'caseone': { ?&gt; &lt;p&gt;Case one&lt;/p&gt; &lt;?php } break;
          case 'casetwo': { ?&gt; &lt;p&gt;Case two&lt;/p&gt; &lt;?php } break;
      }
  ?&gt;
  </code></pre>
  
  <p>Also, we can set variables:</p>
  
  <pre><code>&lt;?php
      switch($example) {
          case 'caseone': $text = 'Case one'; break;
          case 'casetwo': $text = 'Case two'; break;
      }
  ?&gt;
  </code></pre>
  
  <p>But how can we escape the variable string like in this pseudo code?</p>
  
  <pre><code>&lt;?php
      switch($example) {
          case 'caseone': $text = { ?&gt; Case one &lt;?php } break;
          case 'casetwo': $text = { ?&gt; Case two &lt;?php } break;
      }
  ?&gt;
  </code></pre>
  
  <p>I'd like to output a lot of HTML this way, but I don't want to echo it in the switch
  because I have to build a string later containing the $text variable and more.</p>
  
  <p>I might be a bit stupid here.</p>
  
  <p>Thank you very much!</p>