title: Trying to get a full URL without filename in PHP
body: <p>I thought this would be simple but I can't seem to find a variable of <code>$_SERVER</code> array that has what I'm looking for.</p>
  
  <p>Let's say my url is <code>http://example.com/subdirectory/index.php</code>  I want to get all but the filename - <code>http://example.com/subdirectory/</code>.</p>
  
  <p>I know I could quite easily do this with some string manipulation, but I want to know if there's a var of the <code>_server</code> array that I'm just missing.  I've tried all of them to see what they give and I can get anything BUT what I'm looking for.</p>