Posted By

jakepaint on 08/07/07


Tagged

php filename


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

fackz


Get current filename


 / Published in: PHP
 

URL: http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/

This gets the current filename -- from scriptygoddess.com

  1. <?php
  2. $currentFile = $_SERVER["PHP_SELF"];
  3. $parts = Explode('/', $currentFile);
  4. echo $parts[count($parts) - 1];
  5. ?>
  6.  
  7. or
  8.  
  9. <?php
  10. basename($_SERVER[’PHP_SELF’]);
  11. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: djdykes on August 8, 2007

or FILE ?

Posted By: djdykes on August 8, 2007

or _ _ FILE _ _

You need to login to post a comment.