PHP document root in includes
<p>At the moment I have this on every page of my site so I can use the same site code on a dev site on the same server but it seems maybe their is a better way than this?</p>

<pre><code>define("DOC_ROOT", $_SERVER["DOCUMENT_ROOT"]);
$folder=explode("/",DOC_ROOT);

include("/home/".$folder[2]."/header.php"); 
</code></pre>
