How to get base URL with PHP?
<p>I am using <a href="http://en.wikipedia.org/wiki/XAMPP" rel="nofollow">XAMPP</a> on Windows&nbsp;Vista. In my development, I have <code>http://127.0.0.1/test_website/</code>.</p>

<p>How do I get <code>http://127.0.0.1/test_website/</code> with PHP?</p>

<p>I tried something like these, but none of them worked.</p>

<pre><code>echo dirname(__FILE__)
or
echo basename(__FILE__);
etc.
</code></pre>
