title: Are PHP script read from Top to bottom?
body: <p>Are PHP scripts reads from top to bottom? like HTML? because in this code</p>
  
  <pre><code>&lt;?php require_once("./includes/connection.php")?&gt;
  &lt;?php require_once("./includes/functions.inc.php"); ?&gt;
  &lt;?php 
  
      if(isset($_GET['subj']))
      {
          $sel_subj = get_subject_by_id($_GET['subj']);
          $sel_page = NULL;
  
      }else if(isset($_GET['page']))
      {
          $sel_subj = NULL;
          $sel_page = get_page_by_id($_GET['page']);
      }else
      {
          $sel_subj = NULL;
          $sel_page = NULL;
      }
  
  
  ?&gt;
  &lt;?php include("includes/header.inc.php"); ?&gt;
  &lt;table id="structure"&gt;
      &lt;tr&gt;
          &lt;td id="navigation"&gt;
              &lt;ul class = "subjects"&gt;
                  &lt;?php
  
                      $subject_set = get_all_subjects();
  
                      while($subject = mysql_fetch_array($subject_set))
                      {
                          echo "&lt;li";
                          if($subject['id'] == $sel_subj['id']) {echo " class =\"selected\"";}
                          echo "&gt;&lt;a href=\"content.php?subj=" . urlencode($subject["id"]) . 
                          "\"&gt;{$subject["menu_name"]}&lt;/a&gt;&lt;/li&gt;";
  
                          echo "&lt;ul class = 'pages'&gt;";
  
                          $page_set = get_pages_for_subject($subject['id']);
  
                          while($page = mysql_fetch_array($page_set))
                          {
                              echo "&lt;li"; 
                              if($page['id'] == $sel_page['id']){echo " class = \"selected\"";}
                              echo"&gt;&lt;a href=\"content.php?page=" . urlencode($page["id"]) .
                              "\"&gt;{$page["menu_name"]}&lt;/a&gt;&lt;/li&gt;";
                          }
                          echo "&lt;/ul&gt;";
                      }
                  ?&gt;
                  &lt;/ul&gt;
          &lt;/td&gt;
          &lt;td id="page"&gt;
                  &lt;?php if(isset($sel_subj)){?&gt;
                      &lt;h2&gt;&lt;?php echo "{$sel_subj['menu_name']}";?&gt;&lt;/h2&gt;
                  &lt;?php } ?&gt;  
                  &lt;?php if(isset($sel_page)){?&gt;
                      &lt;h2&gt;&lt;?php echo "{$sel_page['menu_name']}"?&gt; &lt;/h2&gt;
                  &lt;?php }?&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;?php require("includes/footer.inc.php"); ?&gt;
  </code></pre>
  
  <p>specifically this part</p>
  
  <pre><code>if(isset($_GET['subj']))
          {
              $sel_subj = get_subject_by_id($_GET['subj']);
              $sel_page = NULL;
  
          }else if(isset($_GET['page']))
          {
              $sel_subj = NULL;
              $sel_page = get_page_by_id($_GET['page']);
          }else
          {
              $sel_subj = NULL;
              $sel_page = NULL;
          }
  </code></pre>
  
  <p>How is this if-else block being called if it's on top of the page? </p>