title: What is this convention of using php code inside the first html tags?
body: <p>I was referring the page.tpl.php(Drupal 7 theme) for understanding the code. I found the following code,</p>
  
  <pre><code>&lt;?php if ($site_name || $site_slogan): ?&gt;
          &lt;!-- !Site name and Slogan --&gt;
          &lt;div&lt;?php print $hgroup_attributes; ?&gt;&gt;
  
            &lt;?php if ($site_name): ?&gt;
              &lt;h1&lt;?php print $site_name_attributes; ?&gt;&gt;&lt;?php print $site_name; ?&gt;&lt;/h1&gt;
            &lt;?php endif; ?&gt;
  
            &lt;?php if ($site_slogan): ?&gt;
              &lt;h2&lt;?php print $site_slogan_attributes; ?&gt;&gt;&lt;?php print $site_slogan; ?&gt;&lt;/h2&gt;
            &lt;?php endif; ?&gt;
  
          &lt;/div&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>Can you see the code in third line, <code>&lt;div&lt;?php print $hgroup_attributes; ?&gt;&gt;</code> WHY the php code is inside the first div tag of html? Same thing in later part of code also, as you can see h1 and h2 code. So, <strong>what is this convention of combining the html and php in so complicated way? and how should I read that?</strong></p>