Hi Maurice,
I usually use preg_match() to check the URL path, like this:
<ul>
<li><a href="/foo/" class="<?php echo preg_match('|/foo|', $_SERVER['SCRIPT_NAME']) ? 'active' : 'inactive' ?>">Foo</a></li>
<li><a href="/bar/" class="<?php echo preg_match('|/bar|', $_SERVER['SCRIPT_NAME']) ? 'active' : 'inactive' ?>">Bar</a></li>
<li><a href="/baaz/" class="<?php echo preg_match('|/baaz|', $_SERVER['SCRIPT_NAME']) ? 'active' : 'inactive' ?>">Baaz</a></li>
<li><a href="/quux/" class="<?php echo preg_match('|/quux|', $_SERVER['SCRIPT_NAME']) ? 'active' : 'inactive' ?>">Quux</a></li>
</ul>
Does that help? Please let me know if you have any questions.
All the best,
Chris