What would be the best way to get the script name without any path details.
eg PHP_SELF gets /path/to/index.php or /really/long/path/to/index.php but I only want index.php
$_SERVER['REQUEST_URI']; is as close as you're gonna get... but you could always do:
$thispage = substr($_SERVER['REQUEST_URI'], strrpos('/', $_SERVER['REQUEST_URI']));
what does that do? still gives me /path/to/index.php
any way to strip all text on the left of the last "/"???
Or:
$path_info = pathinfo($_SERVER['SCRIPT_NAME']); $script = $path_info['basename'];
Edit: Of course, there's always
$script = basename($_SERVER['SCRIPT_NAME']);