$PHP_SELF without the path?
Posted: Sun Apr 01, 2007 12:03 pm
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?
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?