Here is the difference between basename(__FILE__, ".php")
and basename($_SERVER['REQUEST_URI'], ".php")
.
basename(__FILE__, ".php")
shows the name of the file where this code is included - It means that if you include this code in header.php and current page is index.php, it will return header not index.
basename($_SERVER["REQUEST_URI"], ".php")
- If you use include this code in header.php and current page is index.php, it will return index not header.