How to save $_SERVER vars to string
<h1>Solved</h1>

<p>This is a basic example of what I want to do:</p>

<pre><code>$installURL = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']);
$save= $installURL;
$str = str_replace( '/setup', '', $save ); //remove /setup/
$installURL= $save;
</code></pre>

<p>I am trying to save the <code>$_SERVER</code> variables to a string, and then remove a certain portion of the new string.</p>

<p>Currently, the above code does not work.</p>

<p>The current output is: <code>http://localhost/amdin/setup</code></p>

<p>I thought the <code>str_replace</code> would remove that last part. I really want to <code>str_replace</code> remove this instead of using other <code>$_SERVER</code> variables.</p>
