根据URI添加菜单的active css class
Active item item in menu: <?php function aim($page) { if(stristr($_SERVER['REQUEST_URI'], $page)) { return ' class="active"'; } } ?> usage: <style type="text/css"> .active {color: red;} </style> <?php print '<a href="http://example.com/page/hello-world/"'. aim('hello-world') .'>HW</a>'; ?>