Page 1 of 1

$PHP_SELF without the path?

Posted: Sun Apr 01, 2007 12:03 pm
by Matt Phelps
Would appreciate some wisdom here!

I really want to get the name of my page/script and use that variable to define some other functions on the page. $PHP_SELF gives me this info but with the directory path appended to the front.

echo "$PHP_SELF" gives me 'images/page.php'...

...I want 'page.php'.

I can't explode the variable because the url is unpredicable and will give me different results depending on which piece of the exploded array I use.

Is there a similar function to $PHP_SELF that will give me just the script name and nothing else?

Posted: Sun Apr 01, 2007 12:26 pm
by feyd

Posted: Sun Apr 01, 2007 12:27 pm
by Oren