PHP PHP Self Page Name Extraction

Learn how to extract the current page name using PHP's $_SERVER['PHP_SELF'] function.

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