In this tutorial we are going to discuss Get Current File Name using php
Your php script might need the current file name with the given or current directory name in which it is presently executing. In this tutorial, we will explore how to get the current filename of the current PHP script.
<?php
$pageName = basename($_SERVER['PHP_SELF']);
?>
USE:
<body id="body_<?php echo $pageName; ?>">
You can append ID to body to do different styles on different pages.
0 Comments