Get Page Name from Web Address using PHP

With PHP you can recognize the page you are on and then display a proper header for that page.

For example:

// let's say the URL is
$page_name =  basename($_SERVER['PHP_SELF'],".php");
print $page_name; //form


If you have questions about anything on this site, you can find me on Google+: