title: How can I find an application's base url?
body: <p>I'd like to find the base url of my application, so I can automatically reference other files in my application tree...</p>
  
  <p>So given a file config.php in the base of my application, if a file in a subdirectory includes it, knows what to prefix a url with. </p>
  
  <pre><code>application/config.php
  application/admin/something.php
  application/css/style.css
  </code></pre>
  
  <p>So given that <code>http://www.example.com/application/admin/something.php</code> is accessed, I want it to be able to know that the css file is in <code>$approot/css/style.css</code>.  In this case, <code>$approot</code> is "<code>/application</code>" but I'd like it to know if the application is installed elsewhere.</p>
  
  <p>I'm not sure if it's possible, many applications (phpMyAdmin, Squirrelmail I think) have to set a config variable to begin with.  It would be more user friendly if it just knew.</p>