title: PHP - current folder / directory name
body: <p>how can I get the current folder/directory name in PHP?</p>
  
  <p>I have two pages on my site:</p>
  
  <p><code>/about</code> and <code>/help</code> </p>
  
  <p>This is my code (in about and help page):</p>
  
  <pre><code>&lt;?php
  
  echo dirname("index.php");
  
  ?&gt;
  </code></pre>
  
  <p>I want it to return: 'about' if I am on about page. And return 'help' if I am on help page. But it returns nothing.</p>
  
  <p>If I am on this path:
  <code>http://www.website.com/about/index.php</code> I want it to just return <code>about</code></p>