title: How would I get the name of a higher directory in PHP?
body: <p>For example, I'm working on a script to check various settings and permissions. It checks <code>../login/includes/</code> to see if it's writeable, but when it displays an error, I would like to display the full URL to it.</p>
  
  <p>For example, the URL to the installer would be <code>http://example.com/path/to/installer/index.php</code> and when it errors I would like it to display <code>http://example.com/path/to/login/includes/</code> rather than <code>http://example.com/path/to/installer/../login/includes/</code></p>
  
  <p>I'm aware I can use <code>$_SERVER['HTTP_HOST']</code> to get the <code>example.com</code> but I need to know how to get the <code>path/to/</code></p>
  
  <p>Any ideas?</p>