title: How to change the content of a file which is included in different scripts?
body: <p>I am making a website for which I have to make the page active attributes on different lines for different pages. Now I put the whole common script inside a file header and include it in every script. Now how can I change the content of a line when including it on different pages?</p>
  
  <p>The header is as follows:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;title&gt;Bootstrap 101 Template&lt;/title&gt;
  
      &lt;!-- Bootstrap --&gt;
      &lt;link href="css/bootstrap.min.css" rel="stylesheet"&gt;
      &lt;link href="islamic.css" rel="stylesheet"&gt;
      &lt;link href='http://fonts.googleapis.com/css?family=Lato:400,300italic' rel='stylesheet' type='text/css'&gt;
      &lt;!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --&gt;
      &lt;!-- WARNING: Respond.js doesn't work if you view the page via file:// --&gt;
      &lt;!--[if lt IE 9]&gt;
        &lt;script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"&gt;&lt;/script&gt;
        &lt;script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"&gt;&lt;/script&gt;
      &lt;![endif]--&gt;
      &lt;style&gt;
       html,body
       {
            height: 1500px;
       }
      .grey
        {
          background-color: #ccc;
          padding: 20px;
        }
      &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
          &lt;!-- We are going to make this page for navigation purpose --&gt;
  
          &lt;nav class="navbar navbar-inverse navbar-fixed-top" role = "navigation"&gt;
                 &lt;div class="navbar-header"&gt;
                      &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"&gt;
                           &lt;span class="icon-bar"&gt; &lt;/span&gt;
                           &lt;span class="icon-bar"&gt; &lt;/span&gt;
                           &lt;span class="icon-bar"&gt; &lt;/span&gt;
  
                      &lt;/button&gt;
                       &lt;a class="navbar-brand" href="index.php"&gt;ILM&lt;/a&gt;
                 &lt;/div&gt;
  
                 &lt;div class="navbar-collapse collapse"&gt;
                      &lt;ul class="nav navbar-nav"&gt;
                           &lt;li &gt;&lt;a href="index.php"&gt;Home&lt;/a&gt;&lt;/li&gt;
                           &lt;li &gt;&lt;a href="why.php"&gt;Discuss&lt;/a&gt;&lt;/li&gt;
                           &lt;li &gt;&lt;a href="aboutus.php"&gt;About Us&lt;/a&gt;&lt;/li&gt;
                           &lt;li &gt;&lt;a href="contacts.php"&gt;Contact&lt;/a&gt;&lt;/li&gt;
                           &lt;li class="dropdown"&gt;
                            &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt; Social &lt;b class="caret"&gt; &lt;/b&gt;&lt;/a&gt;
                            &lt;ul class="dropdown-menu"&gt;
                              &lt;li&gt; &lt;a href="http://www.facebook.com"&gt;Facebook&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt; &lt;a href="#"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt; &lt;a href="#"&gt;Linked IN&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt; &lt;a href="#"&gt;You Tube&lt;/a&gt;&lt;/li&gt;
                            &lt;/ul&gt;
                            &lt;/li&gt;
                      &lt;/ul&gt;
                 &lt;/div&gt;
          &lt;/nav&gt;
  </code></pre>
  
  <p>I want to change the line </p>
  
  <pre><code>&lt;li &gt;&lt;a href="index.php" &gt;Home&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>&lt;li class="active"&gt;&lt;a href="index.php"&gt;Home&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>for home page.
  Now I want to change the line </p>
  
  <pre><code>&lt;li &gt;&lt;a href="aboutus.php" &gt;About Us&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>&lt;li class="active"&gt;&lt;a href="aboutus.php"&gt;Home&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>for about us page.
  Is it possible in php?</p>