Relative PHP Paths for file_get_contents
<p>This seems like a simple and common task, but we cannot get it to work:</p>

<p>We've got two of us working on a project and both have our machines setup as local servers, with a production environment eventually.</p>

<p>In the head of all of our project we've got PHP Like the following:</p>

<pre><code>$feed = "/lib/php/backend/gateway.php?action=history";
$json = file_get_contents($feed, true);
</code></pre>

<p>Only way to get it to work is to set it as a full URL like <a href="http://dev01.domain.com/lib/php/backend/gateway.php?action=history" rel="nofollow">http://dev01.domain.com/lib/php/backend/gateway.php?action=history</a> or by setting it up as localhost like this:</p>

<pre><code>$feed = "http://localhost/lib/php/backend/gateway.php?action=history";
$json = file_get_contents($feed, true);
</code></pre>

<p>The latter obviously works on our local boxes and presumably would work in production as well, but is there a way to use relative paths to be a bit cleaner? </p>
