title: How generate .php files that refer to the same head.php file?
body: <p>Here is what I have so far</p>
  
  <pre><code>file_put_contents('./'. $dir .'/'. file .'.php','&lt;?php include "../head.php"; echo $head; ?&gt;' . $body);
  </code></pre>
  
  <p>I also tried</p>
  
  <pre><code>file_put_contents('./'. $dir .'/'. file .'.php','&lt;?php include "../head.php"; ?&gt;' . $body);
  </code></pre>
  
  <p>and then <code>echo $head;</code> in the /head.php</p>
  
  <p>I want a head.php that is called by each of the generated files. There for I need to insert the php code <code>&lt;?php include "../head.php"; ?&gt;</code> on top of the files.
  with the given code <code>&lt;?php include "../head.php"; ?&gt;</code> it shows ï»¿ on top.</p>
  
  <p>head.php </p>
  
  <pre><code>echo '&lt;html&gt;...';
  echo $_SERVER['REQUEST_URI'];
  ...
  </code></pre>
  
  <p>The issue is, it shows ï»¿.
  I don't think this is a dupe.</p>