deadonarrival Posted July 15, 2007 Share Posted July 15, 2007 If I use $_SERVER['PHP_SELF'] I get /pages/jonathanstory/index.php But I only want the index.php portion of the page - is there any simple way to do this? Link to comment https://forums.phpfreaks.com/topic/60023-get-the-name-of-the-file-but-only-the-file/ Share on other sites More sharing options...
infid3l Posted July 15, 2007 Share Posted July 15, 2007 There may/must be, but you could do this: <?php $filename = explode("/", $_SERVER['PHP_SELF']); $filename = $filename[count($filename)-1]; ?> Link to comment https://forums.phpfreaks.com/topic/60023-get-the-name-of-the-file-but-only-the-file/#findComment-298527 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.