title: How to get the parent folder of current file
body: <p>url 1 - <code>localhost/ocean/</code><br>
  url 2 - <code>localhost/ocean/index.php</code></p>
  
  <pre><code>$file = basename($_SERVER['PHP_SELF']);
  echo $file;
  </code></pre>
  
  <p>In both cases result is <code>index.php</code> and that's ok.</p>
  
  <p>Now, I need to get parent folder of current file.
  So, in both cases result should be <code>ocean</code>.  </p>
  
  <p>Any help?</p>