On my site I use htaccess url rewriting to remove php extensions completly from php files.
Php extension gets removed completly, /file.php maps to /file.
My
you can use this method also
htmlspecialchars(basename($_SERVER["PHP_SELF"], '.php'), ENT_QUOTES, "utf-8")