title: What's the difference between $_SERVER['PHP_SELF'] and $_SERVER['SCRIPT_NAME']?
body: <p>I have a php framework and I used <code>$_SERVER['SCRIPT_NAME']</code> to optimize portability. That way I don't need to manually configure the path anymore.</p>
  
  <pre><code>$this-&gt;base_url = str_replace('index.php', '', 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']);
  </code></pre>
  
  <p>But I noticed that <code>$_SERVER['SCRIPT_NAME']</code> and <code>$_SERVER['PHP_SELF']</code> returns the exact same string. So, what's the difference? How should I choose between them?</p>