jonsamwell Posted January 9, 2009 Share Posted January 9, 2009 Hi, How can i get the name of the php page the script is running in? I can get the path like this: $_SERVER['PHP_SELF']; but not the name of the php file. Any ideas? Regards Jon Link to comment https://forums.phpfreaks.com/topic/140127-get-name-of-current-php-page/ Share on other sites More sharing options...
vbnullchar Posted January 9, 2009 Share Posted January 9, 2009 theres a shorter method out there.. but this stil works $parts = Explode('/', __FILE__); $file = $parts[count($parts) - 1]; echo $file; Link to comment https://forums.phpfreaks.com/topic/140127-get-name-of-current-php-page/#findComment-733168 Share on other sites More sharing options...
jonsamwell Posted January 9, 2009 Author Share Posted January 9, 2009 Brilliant Thanks Again! Link to comment https://forums.phpfreaks.com/topic/140127-get-name-of-current-php-page/#findComment-733177 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.