getting $PHP_SELF's basename
| From: | Erik Price | Date: | Tue, 12 Feb 2002 21:16:49 +0000 |
| Subject: | getting $PHP_SELF's basename | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-84457@lists.php.net to get a copy of this message | ||
Is there already a built-in function that gets the basename of the current file?
I wrote this:
function get_current_page_name()
{
$current_page_name = explode("/", $_SERVER['PHP_SELF']);
$current_page_name = array_slice($current_page_name, -1);
return $current_page_name;
}
but I'm wondering if someone already did it for me.
Erik
----
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
pricee@hhbrown.com