为什么此代码不保留在我的导航中选择的项目?
<?php
function navItemSelected($pg)
{
global $pgname;
if ($pg == $pgname)
{
echo "active";
}
}
?>
<!-- ===== NAVIGATION ===== -->
<div id="navigation">
<div class="wrapper">
<div id="menu">
<ul>
<li class="home"><a href="index.php" class="<?php echo navItemSelected('home'); ?>">home</a></li>
</ul>
</div>
</div>