Page 1 of 1

Simple Question about $PHP_SELF;

Posted: Tue Jun 13, 2006 10:41 am
by tecktalkcm0391
I know that $PHP_SELF; gets the current location like if it was example.com/Login/index.php it would output //Login/index.php, but how could I just get the index.php with out the other stuff?

Thanks!

Posted: Tue Jun 13, 2006 10:47 am
by ambivalent
basename()

Posted: Tue Jun 13, 2006 10:48 am
by pedrotuga
use the explode function and get the last piece

http://www.php.net/explode

Posted: Tue Jun 13, 2006 10:49 am
by JayBird

Posted: Tue Jun 13, 2006 10:51 am
by feyd
If you want the current filename, __FILE__ is much better and safer, by far.