<div class="navbar-collapse collapse ">
<? $menu = array ("Главная"=>"/index.php", "ПОРТФОЛИО"=>"/portfolio.php", "Блог"=>"/blog.php", "Контакты"=>"/contact.php",);
echo "<ul class='nav navbar-nav'>";
foreach ($menu as $title=>$url) {
$class = strpos($_SERVER["PHP_SELF"], $url) !== false ? " class='active'" : "";
echo "<li$class><a href='$url'>$title</a><li>";
}
echo "</ul>";?>
</div>