Have you ever found it necessary to get page name of currently opened PHP file. If Yes, Then following one line of code can be useful for you.

<?php
$page = basename($_SERVER['PHP_SELF']);
?>

Example

If your URL is http://www.domain.com/page.php then you will get string page.php on printing $page variable in above given code.