Get current page name in PHP

TO get current page name which are running in browser just use below one line Php code.
<?php function curPageName() { return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1); }
echo "The current page name is ".curPageName(); ?>

Post a Comment

0 Comments