<?php

function isActive($paths, $exact = false) {
    $current = $_SERVER['REQUEST_URI'];
    if ($exact) {
        return ($current == $paths || $current == $paths . '/') ? 'active' : '';
    }
    foreach ((array)$paths as $path) {
        if (strpos($current, $path) !== false) {
            return 'active';
        }
    }
    return '';
}

?>
