title: PHP syntax alternatives?
body: <p>Are there any way to use this alternative syntax?</p>
  
  <pre><code>&lt;div class="lines-rates"&gt;
  &lt;?php foreach($info as $k =&gt; $v){ echo : ?&gt;
  &lt;div&gt;&lt;span&gt;{$k}&lt;/span&gt;{$v}&lt;/div&gt;&lt;?php ; } ?&gt;
  &lt;/div&gt;&lt;!-- #lines --&gt;
  </code></pre>
  
  <p>I mean:</p>
  
  <pre><code>&lt;?php echo : ?&gt;&lt;p&gt;this is your {$username} And this html code could be more than one line and sure other html elements also&lt;/p&gt;&lt;?php endecho; ?&gt;
  </code></pre>
  
  <p>So we can easily see html code.</p>
  
  <p><strong>I want to have html inside PHP. Not PHP inside html.</strong></p>
  
  <pre><code>&lt;?php echo '&lt;p&gt;this is your '.$username.' And this html code could be more than one line and sure other html elements also&lt;/p&gt;'; ?&gt; 
  </code></pre>
  
  <p>It's definitely not the way that I want.</p>
  
  <p>I'm using </p>
  
  <pre><code>&lt;?php if($info) : ?&gt;
  &lt;div class="lines-rates"&gt;
  &lt;?php foreach($info as $k =&gt; $v){ echo "&lt;div&gt;&lt;span&gt;{$k}&lt;/span&gt;{$v}&lt;/div&gt;"; } ?&gt;
  &lt;/div&gt;&lt;!-- #lines --&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>I do not want to use html inside php.. Like </p>
  
  <pre><code>&lt;?php echo "&lt;div&gt;&lt;span&gt;{$k}&lt;/span&gt;{$v}&lt;/div&gt;";?&gt;
  </code></pre>
  
  <p>Also following line is possible but this is too verbose for me - is it not? Why do I have to write <code>&lt;?php echo $k; ?&gt;</code> to echo simple variable?</p>
  
  <pre><code>&lt;?php $if($info) : ?&gt;
  &lt;h2&gt;Weekly Charter Rates &lt;/h2&gt;
  &lt;div class="lines-rates"&gt;
  &lt;?php foreach($info as $k =&gt; $v) : ?&gt; 
  &lt;div&gt;&lt;span&gt;&lt;?php echo $k; ?&gt;&lt;/span&gt;&lt;?php echo $k; ?&gt;&lt;/div&gt;
  &lt;?php endforeach; ?&gt;
  &lt;/div&gt;&lt;!-- #lines --&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>I need clean and pure code as much as possible.</p>
  
  <p>This type of writing again fails.</p>
  
  <pre><code>&lt;?php foreach($info as $k =&gt; $v) : echo &lt;&lt;&lt;EOT ?&gt;
  &lt;p&gt;this is your {$username}&lt;/p&gt;
  ...
  some more html
  ..&lt;div&gt;&lt;span&gt;$k&lt;/span&gt;$k&lt;/div&gt;
  &lt;?php EOT; ?&gt; 
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>It was almost best way.</p>