Get current page file name with PHP
Free Scripts :: PHP :: String :: Get current page file name with PHP
Author: Salman Javaid
Website: http://www.salman.be
Website: http://www.salman.be
- How to get current webpage file name with PHP.
- Custom PHP function get current page name.
Function returns the name of currently opened page.
Function
function getPageName() {
return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
}
Calling The Function
echo getPageName();
Output
login.php




