I want the class of the tag to change under the active dirrectory...
now
It's probably easier to do with jQuery but this works:
$url='http://example.com/tutorials/css/flawless-dropdown-menu';//pass the current url here instead of a static string.
$segments = explode ("/",$url);
$menuItems=array('Tutorials','Resources', 'Library', 'Our-Projects','Community');
$menu=array();
foreach ($menuItems as $menuItem) {
if($segments[3]==strtolower($menuItem)){
$menu[]=('- '.str_replace("-"," ",$menuItem).'
');
} else {
$menu[]=('- '.str_replace("-"," ",$menuItem).'
');
}
}
foreach ($menu as $item) {
echo $item.'
';
}