title: Best practice for HTML head in PHP
body: <p>I currently have a very simple page, with some more complicated backend. I've always done this the same way, but I feel it's not right. But I haven't come up with much useful to me. </p>
  
  <p>I've got my index.php, header.php and function.php. index.php includes header.php, which calls a function from function.php. The main thing I'm not sure about is how to make the website dynamic enough that it can have easily editable pages, but also be easily editable is a big part of it needs editing.<br>
  index.php</p>
  
  <pre><code>&lt;?php
  session_start();
  include_once 'header.php';
  ?&gt;
  // Page content
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>header.php</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html lan="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;link rel="stylesheet" href="style.css" type="text/css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;?php
  require_once 'functions.php';
  getBar(); // Top of page bar with menu/login etc
  ?&gt;
  </code></pre>
  
  <p>I don't think showing functions.php would add that much. I know I shouldn't use 2 <code>&lt;head&gt;</code>s in my file, so what do I do if I want to have a description on each page? I've previously had the files setup like:
  index.php</p>
  
  <pre><code>&lt;?php
  session_start();
  include_once 'header.php';
  ?&gt;
  // extra page specific stuff here, such as description or JS
  &lt;/head&gt;
  &lt;body&gt;
  &lt;?php
  require_once 'functions.php';
  getBar(); // Top of page bar with menu/login etc
  ?&gt;
  // Page content here
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>header.php</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html lan="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;link rel="stylesheet" href="style.css" type="text/css" /&gt;
  </code></pre>
  
  <p>However, I think the files are "fragmented". I don't know if there is a generally accepted way of doing this, but if there is, I'd love to hear it!</p>