get current page name for page active class

Solutions on MaxInterview for get current page name for page active class by the best coders in the world

showing results for - "get current page name for page active class"
Alex
09 Jun 2016
1<?php
2$url = basename($_SERVER['PHP_SELF']);
3?>
4//nav bar
5<li  <?=  ($url === "dashboard.php") ? "class='active'"?>><a href='dashboard.php'> Dashboard</a></li>
6<li <?= ($url === "bankdetails.php")? "class='active'"; ?>><a href="bankdetails.php"> Bank Account Details</a></li>
7