title: get file name for url php
body: <p>I wanted to know how to get the current file name in PHP to be able to load the same file in a different directory.</p>
  
  <pre><code>index.php
  works.php
  
  lang/de/
     index.php
     works.php
  lang/pl/
     index.php
     works.php
  
  &lt;div id="language"&gt;
      &lt;a href="../../index.php" class="lang"&gt;EN&lt;/a&gt;
      &lt;a class="lang" href="index.php"&gt;DE&lt;/a&gt;
      &lt;a class="lang" href="../pl/index.php"&gt;PL&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The current method is redirecting the lang URL, allways to index.php.
  I would love to know how to redirect from works.php to lang/de/works.php without redirecting to lang/de/index.php</p>
  
  <p>Sorry if i'm getting you confused</p>