title: PHP absolute root path and root url
body: <p>Im trying to define the absolute root path and the root url of my app.
  I tried <a href="https://stackoverflow.com/questions/176712/how-can-i-find-an-applications-base-url#answer-185725">this</a>,  however I can't understand something yet.</p>
  
  <p>I have created <code>config.inc.php</code> in the <code>root</code> folder with the code in the answer.
  Also I have the file <code>index.php</code> in the <code>root</code> in which I include <code>config.inc.php</code> and the constanst are fine. But I have another file in <code>${ROOT}/example/file.php</code> where I also include <code>config.inc.php</code> but the root url contains the example folder in the end.</p>
  
  <p>The app structure is:</p>
  
  <pre><code>config.inc.php
  index.php
  example/file.php
  </code></pre>
  
  <p>How can I always have the absolute root path and the root url of my app?</p>
  
  <p>Thanks!</p>