Tutorial Get Current File Name

by in , 0

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

Potential use:

<body id="body_<?php echo $pageName; ?>">

Append ID to body to do different CSS styles on different pages.

Leave a Reply