Can this PHP function be improved?
<p>Below is some code I am working on for a navigation menu, if you are on a certain page, it will add a "current" css class to the proper tab.  </p>

<p>I am curious if there is a better way to do this in PHP because it really seems like a lot of code to do such a simple task?  My pages will also have a jquery library already loaded, would it be better to set the tab with jquery instead of PHP?  Any tips appreciated</p>

<pre><code>&lt;?PHP

active_header('page identifier goes here'); //ie; 'home' or 'users.online'

function active_header($page_name)
{

    // arrays for header menu selector
    $header_home = array('home' =&gt; true);
    $header_users = array(
        'users.online' =&gt; true,
        'users.online.male' =&gt; true, 
        'users.online.female' =&gt; true, 
        'users.online.friends' =&gt; true, 
        'users.location' =&gt; true, 
        'users.featured' =&gt; true, 
        'users.new' =&gt; true, 
        'users.browse' =&gt; true, 
        'users.search' =&gt; true, 
        'users.staff' =&gt; true
    );
    $header_forum = array('forum' =&gt; true);
    $header_more = array(
        'widgets' =&gt; true, 
        'news' =&gt; true, 
        'promote' =&gt; true, 
        'development' =&gt; true, 
        'bookmarks' =&gt; true, 
        'about' =&gt; true
    );
    $header_money = array(
        'account.money' =&gt; true, 
        'account.store' =&gt; true, 
        'account.lottery' =&gt; true, 
        'users.top.money' =&gt; true
    );
    $header_account = array('account' =&gt; true);
    $header_mail = array(
        'mail.inbox' =&gt; true, 
        'mail.sentbox' =&gt; true, 
        'mail.trash' =&gt; true, 
        'bulletins.post' =&gt; true, 
        'bulletins.my' =&gt; true, 
        'bulletins' =&gt; true
    );

    // set variables if there array value exist
    if (isset($header_home[$page_name])){
        $current_home = 'current';
    }else if (isset($header_users[$page_name])){
        $current_users = 'current';
    }else if (isset($header_forum[$page_name])){
        $current_forum = 'current';
    }else if (isset($header_more[$page_name])){
        $current_more = 'current';
    }else if (isset($header_money[$page_name])){
        $current_money = 'current';
    }else if (isset($header_account[$page_name])){
        $current_account = 'current';
    }else if (isset($header_mail[$page_name])){
        $current_mail = 'current';
    }

    // show the links
    echo '&lt;li class="' . (isset($current_home) ? $current_home : '') . '"&gt;&lt;a href=""&gt;&lt;em&gt;Home&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;';
    echo '&lt;li class="' . (isset($current_users) ? $current_users : '') . '"&gt;&lt;a href=""&gt;&lt;em&gt;Users&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;';
    echo '&lt;li class="' . (isset($current_forum) ? $current_forum : '') . '"&gt;&lt;a href=""&gt;&lt;em&gt;Forum&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;';
    echo '&lt;li class="' . (isset($current_more) ? $current_more : '') . '"&gt;&lt;a href=""&gt;&lt;em&gt;More&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;';
    echo '&lt;li class="' . (isset($current_money) ? $current_money : '') . '"&gt;&lt;a href=""&gt;&lt;em&gt;Money&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;';
    echo '&lt;li class="' . (isset($current_account) ? $current_account : '') . '"&gt;&lt;a href=""&gt;&lt;em&gt;Account&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;';
    echo '&lt;li class="' . (isset($current_mail) ? $current_mail : '') . '"&gt;&lt;a href=""&gt;&lt;em&gt;Mail&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;';
}

?&gt;
</code></pre>
