Easiest way to get the root domain of a website
<p>I'm trying to figure out the easiest way to get the "http://www.mydomain.com" portion of my website in code instead of having to change it manually between my development and production servers. I'm sure this is really simple, but I can't seem to find it.</p>

<p>Thanks!</p>
