<?php
$url = explode('/',$_SERVER['REQUEST_URI']);
$text = '-'.$url[2].'-'.$url[3];
?>
<script>$('#Nav<?= $text; ?>').addClass("active");</script>