I am using this code to highlight the active link in navigation, but the code is not working. When I echo $_SERVER['PHP_SELF']
this, it gives 's' string as the output on localhost. Please help, what is wrong here?
P.S. Also when I checked apache error.log it is showing:
[Wed Feb 19 18:28:08.671229 2014] [:error] [pid 1353] [client 127.0.0.1:57968] PHP Warning: Illegal string offset 'PHP_SELF'
I'm using Ubuntu 13.10.
<li <?php if($_SERVER['PHP_SELF'] == "index.php"){ echo 'class="active"';}?> > <a href="index.php"><i class="fa fa-dashboard"></i> Dashboard</a></li>