Get Page Name from Web Address using PHP
This syntax is useful for dynamically creating web pages. For example with PHP you can recognize the page you are on and then display a proper header for that page.
i.e. let’s say the weblink is “www.page.com/form.php”
View Code PHP
$page_name = basename($_SERVER['PHP_SELF'],".php"); |
The “$page_name” would equal “form” for the .php was dropped.




